mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-30 01:05:24 +00:00
add enum for all collision
This commit is contained in:
@@ -19,7 +19,8 @@ namespace BBM
|
||||
enum CollidedAxis {
|
||||
X = 1,
|
||||
Y = 2,
|
||||
Z = 4
|
||||
Z = 4,
|
||||
ALL = 7
|
||||
};
|
||||
|
||||
//! @brief onCollide functions to be called
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace BBM {
|
||||
void Bonus::BombUpBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis)
|
||||
{
|
||||
if (bonus.shouldDelete() || axis != 7)
|
||||
if (bonus.shouldDelete() || axis != CollisionComponent::CollidedAxis::ALL)
|
||||
return;
|
||||
auto *bombHolder = player.tryGetComponent<BombHolderComponent>();
|
||||
if (!bombHolder)
|
||||
@@ -22,7 +22,7 @@ namespace BBM {
|
||||
|
||||
void Bonus::ExplosionRangeBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis)
|
||||
{
|
||||
if (bonus.shouldDelete() || axis != 7)
|
||||
if (bonus.shouldDelete() || axis != CollisionComponent::CollidedAxis::ALL)
|
||||
return;
|
||||
auto *bombHolder = player.tryGetComponent<BombHolderComponent>();
|
||||
auto *playerBonus = player.tryGetComponent<PlayerBonusComponent>();
|
||||
@@ -33,7 +33,7 @@ namespace BBM {
|
||||
|
||||
void Bonus::SpeedUpBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis)
|
||||
{
|
||||
if (bonus.shouldDelete() || axis != 7)
|
||||
if (bonus.shouldDelete() || axis != CollisionComponent::CollidedAxis::ALL)
|
||||
return;
|
||||
auto *controllable = player.tryGetComponent<ControllableComponent>();
|
||||
auto *playerBonus = player.tryGetComponent<PlayerBonusComponent>();
|
||||
@@ -45,7 +45,7 @@ namespace BBM {
|
||||
|
||||
void Bonus::NoClipBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis)
|
||||
{
|
||||
if (bonus.shouldDelete() || axis != 7)
|
||||
if (bonus.shouldDelete() || axis != CollisionComponent::CollidedAxis::ALL)
|
||||
return;
|
||||
auto *playerBonus = player.tryGetComponent<PlayerBonusComponent>();
|
||||
if (!playerBonus)
|
||||
|
||||
Reference in New Issue
Block a user