mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-07 11:34:46 +00:00
Reworking systems
This commit is contained in:
@@ -8,11 +8,8 @@
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
MovableSystem::MovableSystem()
|
||||
: WAL::System({
|
||||
typeid(MovableComponent),
|
||||
typeid(PositionComponent)
|
||||
})
|
||||
MovableSystem::MovableSystem(WAL::Wal &wal)
|
||||
: System(wal)
|
||||
{}
|
||||
|
||||
void MovableSystem::onFixedUpdate(WAL::Entity &entity)
|
||||
|
||||
@@ -5,25 +5,26 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Component/Movable/MovableComponent.hpp"
|
||||
#include "System/System.hpp"
|
||||
#include "Entity/Entity.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
//! @brief A system to handle movable entities. This system update velocity based on accelerations and positions based on velocity.
|
||||
class MovableSystem : public WAL::System
|
||||
class MovableSystem : public WAL::System<MovableComponent, PositionComponent>
|
||||
{
|
||||
public:
|
||||
//! @inherit
|
||||
void onFixedUpdate(WAL::Entity &entity) override;
|
||||
|
||||
//! @brief A default constructor
|
||||
MovableSystem();
|
||||
explicit MovableSystem(WAL::Wal &wal);
|
||||
//! @brief A movable system is copy constructable
|
||||
MovableSystem(const MovableSystem &) = default;
|
||||
//! @brief A default destructor
|
||||
~MovableSystem() override = default;
|
||||
//! @brief A movable system is assignable.
|
||||
MovableSystem &operator=(const MovableSystem &) = default;
|
||||
//! @brief A system is not assignable.
|
||||
MovableSystem &operator=(const MovableSystem &) = delete;
|
||||
};
|
||||
} // namespace WAL
|
||||
|
||||
Reference in New Issue
Block a user