Small refactoring in Placeable.

This commit is contained in:
King_DuckZ 2014-02-22 17:06:25 +01:00
parent 85c65b3e68
commit ac85f96907
4 changed files with 26 additions and 16 deletions

View file

@ -8,22 +8,32 @@ namespace cloonel {
class Placeable {
public:
const float2& GetPos ( void ) const noexcept { return m_pos; }
const float2& QueryPosition ( void ) const noexcept { return m_pos; }
void AddOffset ( const float2& parOffset ) noexcept { m_pos += parOffset; }
float2 GetPos ( void ) const noexcept;
void AddOffset ( const float2& parOffset ) noexcept;
void SwapMover ( Mover* parMover );
protected:
Placeable ( float parX, float parY );
explicit Placeable ( float2 parPos );
~Placeable ( void ) noexcept = default;
float2 m_pos;
private:
float2 m_pos;
Mover* m_mover;
int m_idForMover;
};
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
inline void Placeable::AddOffset (const float2& parOffset) noexcept {
m_pos += parOffset;
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
inline float2 Placeable::GetPos() const noexcept {
return m_pos;
}
} //namespace cloonel
#endif