mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-21 13:55:10 +00:00
Adding a position componentn and a vector3
This commit is contained in:
48
lib/wal/sources/Component/Basics/PositionComponent.cpp
Normal file
48
lib/wal/sources/Component/Basics/PositionComponent.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Created by Zoe Roux on 5/17/21.
|
||||
//
|
||||
|
||||
#include "PositionComponent.hpp"
|
||||
|
||||
namespace WAL::Components
|
||||
{
|
||||
PositionComponent::PositionComponent(Entity &entity)
|
||||
: Component(entity),
|
||||
_position()
|
||||
{}
|
||||
|
||||
PositionComponent::PositionComponent(float x, float y, float z, Entity &entity)
|
||||
: Component(entity),
|
||||
_position(x, y, z)
|
||||
{}
|
||||
|
||||
Component *PositionComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new PositionComponent(entity);
|
||||
}
|
||||
|
||||
Vector3f &PositionComponent::getPosition()
|
||||
{
|
||||
return this->_position;
|
||||
}
|
||||
|
||||
const Vector3f &PositionComponent::getPosition() const
|
||||
{
|
||||
return 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