mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-05 10:59:48 +00:00
01982d00fe
# Conflicts: # sources/Component/BombHolder/BombHolderComponent.cpp # sources/Map/Map.cpp
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
//
|
|
// Created by Tom Augier on 2021-05-20.
|
|
// Edited by Benjamin Henry on 2021-05-20.
|
|
// Edited by Louis Auzuret on 2021-05-20.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "Component/Component.hpp"
|
|
#include "Entity/Entity.hpp"
|
|
#include <chrono>
|
|
|
|
using namespace std::chrono_literals;
|
|
|
|
namespace BBM
|
|
{
|
|
class BombHolderComponent : public WAL::Component
|
|
{
|
|
public:
|
|
//! @brief The number of bomb that this entity hold.
|
|
unsigned int bombCount = 1;
|
|
//! @brief The max number of bomb that this entity can have.
|
|
unsigned int maxBombCount = 3;
|
|
//! @brief The number of seconds of each refill. This variable is used to reset the nextBombRefill value.
|
|
std::chrono::nanoseconds refillRate = 1s;
|
|
//! @brief The number of nanosecond before the next bomb refill.
|
|
std::chrono::nanoseconds nextBombRefill = refillRate;
|
|
//! @brief The radius of the explosion.
|
|
unsigned int explosionRadius = 3;
|
|
//! @brief The damage made by the explosion on an entity
|
|
int damage = 1;
|
|
|
|
//! @inherit
|
|
WAL::Component *clone(WAL::Entity &entity) const override;
|
|
|
|
//! @brief A component can't be instantiated, it should be derived.
|
|
explicit BombHolderComponent(WAL::Entity &entity);
|
|
|
|
//! @brief Constructor
|
|
BombHolderComponent(WAL::Entity &entity, unsigned int maxBombCount, unsigned int bombExplosionRadius = 3);
|
|
|
|
//! @brief A component can't be instantiated, it should be derived.
|
|
BombHolderComponent(const BombHolderComponent &) = default;
|
|
|
|
//! @brief default destructor
|
|
~BombHolderComponent() override = default;
|
|
|
|
//! @brief A component can't be assigned
|
|
BombHolderComponent &operator=(const BombHolderComponent &) = delete;
|
|
};
|
|
} |