Starting the grid centered system

This commit is contained in:
Zoe Roux
2021-05-27 12:11:34 +02:00
parent 384e812c19
commit c6ab6542e0
2 changed files with 31 additions and 0 deletions

View File

@@ -2,4 +2,24 @@
// Created by Zoe Roux on 5/24/21.
//
#include "Component/Movable/MovableComponent.hpp"
#include "Component/GridCentered/GridCenteredComponent.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 * )
}
}

View File

@@ -8,8 +8,19 @@
namespace BBM
{
//! @brief The system handling GridCenteredComponent
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;
};
}