add enum for all collision

This commit is contained in:
Askou
2021-06-15 11:58:53 +02:00
parent eefc560a81
commit bb2a9ec081
2 changed files with 6 additions and 5 deletions
@@ -19,7 +19,8 @@ namespace BBM
enum CollidedAxis {
X = 1,
Y = 2,
Z = 4
Z = 4,
ALL = 7
};
//! @brief onCollide functions to be called
+4 -4
View File
@@ -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)