mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-07 19:40:48 +00:00
bumperComponent + fix map
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Tom Augier on 2021-05-20.
|
||||
//
|
||||
|
||||
#include "BumperTimerComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
BumperTimerComponent::BumperTimerComponent(WAL::Entity &entity)
|
||||
: WAL::Component(entity)
|
||||
{}
|
||||
|
||||
WAL::Component *BumperTimerComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new BumperTimerComponent(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Created by Tom Augier on 2021-05-20.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include "Component/Component.hpp"
|
||||
#include "Entity/Entity.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
class BumperTimerComponent : public WAL::Component
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
bool _isReseting = false;
|
||||
//! @brief The number of seconds of each refill. This variable is used to reset the nextBombRefill value.
|
||||
std::chrono::nanoseconds resetRate = 1500ms;
|
||||
//! @brief The number of nanosecond before the next bomb refill.
|
||||
std::chrono::nanoseconds nextReset = resetRate;
|
||||
|
||||
//! @inherit
|
||||
WAL::Component *clone(WAL::Entity &entity) const override;
|
||||
|
||||
//! @brief Constructor
|
||||
BumperTimerComponent(WAL::Entity &entity);
|
||||
|
||||
//! @brief A BumperTimer component can't be instantiated, it should be derived.
|
||||
BumperTimerComponent(const BumperTimerComponent &) = default;
|
||||
|
||||
//! @brief default destructor
|
||||
~BumperTimerComponent() override = default;
|
||||
|
||||
//! @brief A BumperTimer component can't be assigned
|
||||
BumperTimerComponent &operator=(const BumperTimerComponent &) = delete;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user