bumperComponent + fix map

This commit is contained in:
Askou
2021-06-10 11:24:47 +02:00
parent 69563ad075
commit 4a1e7b085f
9 changed files with 153 additions and 6 deletions
@@ -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;
};
}