mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-21 13:55:10 +00:00
Starting the grid centered system
This commit is contained in:
@@ -2,4 +2,24 @@
|
|||||||
// Created by Zoe Roux on 5/24/21.
|
// Created by Zoe Roux on 5/24/21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "Component/Movable/MovableComponent.hpp"
|
||||||
|
#include "Component/GridCentered/GridCenteredComponent.hpp"
|
||||||
#include "GridCenteredSystem.hpp"
|
#include "GridCenteredSystem.hpp"
|
||||||
|
|
||||||
|
namespace BBM
|
||||||
|
{
|
||||||
|
GridCenteredSystem::GridCenteredSystem()
|
||||||
|
: WAL::System({
|
||||||
|
typeid(GridCenteredComponent),
|
||||||
|
typeid(MovableComponent),
|
||||||
|
// typeid(PositionComponent)
|
||||||
|
})
|
||||||
|
{}
|
||||||
|
|
||||||
|
void GridCenteredSystem::onFixedUpdate(WAL::Entity &entity)
|
||||||
|
{
|
||||||
|
auto &grid = entity.getComponent<GridCenteredComponent>();
|
||||||
|
auto &movement = entity.getComponent<MovableComponent>();
|
||||||
|
// movement.addForce(grid.force * )
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,8 +8,19 @@
|
|||||||
|
|
||||||
namespace BBM
|
namespace BBM
|
||||||
{
|
{
|
||||||
|
//! @brief The system handling GridCenteredComponent
|
||||||
class GridCenteredSystem : public WAL::System
|
class GridCenteredSystem : public WAL::System
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
void onFixedUpdate(Entity &entity) override;
|
||||||
|
|
||||||
|
//! @brief A default constructor
|
||||||
|
GridCenteredSystem();
|
||||||
|
//! @brief A GridCenteredSystem is copyable.
|
||||||
|
GridCenteredSystem(const GridCenteredSystem &) = default;
|
||||||
|
//! @brief A default destructor
|
||||||
|
~GridCenteredSystem() override = default;
|
||||||
|
//! @brief A GridCenteredSystem is assignable
|
||||||
|
GridCenteredSystem &operator=(const GridCenteredSystem &) = default;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user