mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-03 10:26:29 +00:00
@@ -4,17 +4,19 @@
|
||||
|
||||
#include "BasicBombComponent.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, unsigned ownerID)
|
||||
: WAL::Component(entity),
|
||||
damage(damage),
|
||||
explosionRadius(explosionRadius),
|
||||
ownerID(ownerID)
|
||||
BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, std::vector<unsigned> ignored)
|
||||
: WAL::Component(entity),
|
||||
damage(damage),
|
||||
explosionRadius(explosionRadius),
|
||||
ignoredEntities(std::move(ignored))
|
||||
{}
|
||||
|
||||
WAL::Component *BasicBombComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new BasicBombComponent(entity, this->damage, this->explosionRadius, this->ownerID);
|
||||
return new BasicBombComponent(entity, this->damage, this->explosionRadius, this->ignoredEntities);
|
||||
}
|
||||
}
|
||||
@@ -19,16 +19,14 @@ namespace BBM
|
||||
const int explosionRadius = 3;
|
||||
//! @brief The damage made by the explosion on an entity
|
||||
const int damage = 1;
|
||||
//! @brief The ID of the owner.
|
||||
unsigned ownerID;
|
||||
//! @brief Should collisions with the owner be disabled.²
|
||||
bool ignoreOwner = true;
|
||||
//! @brief The list of IDs of ignored entities.
|
||||
std::vector<unsigned> ignoredEntities;
|
||||
|
||||
//! @inherit
|
||||
WAL::Component *clone(WAL::Entity &entity) const override;
|
||||
|
||||
//! @brief A component can't be instantiated, it should be derived.
|
||||
explicit BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, unsigned ownerID);
|
||||
explicit BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, std::vector<unsigned> ignored);
|
||||
|
||||
//! @brief A component can't be instantiated, it should be derived.
|
||||
BasicBombComponent(const BasicBombComponent &) = default;
|
||||
|
||||
Reference in New Issue
Block a user