mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-22 06:15:11 +00:00
Adding a movable system/component
This commit is contained in:
43
lib/wal/sources/Component/Position/PositionComponent.cpp
Normal file
43
lib/wal/sources/Component/Position/PositionComponent.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// Created by Zoe Roux on 5/17/21.
|
||||
//
|
||||
|
||||
#include "PositionComponent.hpp"
|
||||
|
||||
namespace WAL
|
||||
{
|
||||
PositionComponent::PositionComponent(Entity &entity)
|
||||
: Component(entity),
|
||||
position()
|
||||
{}
|
||||
|
||||
PositionComponent::PositionComponent(Entity &entity, Vector3f pos)
|
||||
: Component(entity),
|
||||
position(pos)
|
||||
{}
|
||||
|
||||
PositionComponent::PositionComponent(Entity &entity, float x, float y, float z)
|
||||
: Component(entity),
|
||||
position(x, y, z)
|
||||
{}
|
||||
|
||||
Component *PositionComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new PositionComponent(entity, this->position);
|
||||
}
|
||||
|
||||
float PositionComponent::getX() const
|
||||
{
|
||||
return this->position.x;
|
||||
}
|
||||
|
||||
float PositionComponent::getY() const
|
||||
{
|
||||
return this->position.y;
|
||||
}
|
||||
|
||||
float PositionComponent::getZ() const
|
||||
{
|
||||
return this->position.z;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user