2020-03-02 11:04:17 -05:00
|
|
|
#ifndef ENTITY_H
|
|
|
|
#define ENTITY_H
|
|
|
|
|
2020-03-15 17:57:39 -04:00
|
|
|
using coordinate = unsigned long;
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
/// Interface representing entity which can be placed on the map
|
|
|
|
class Entity
|
|
|
|
{
|
|
|
|
protected:
|
2020-03-15 17:57:39 -04:00
|
|
|
coordinate entity_row, entity_col;
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
public:
|
2020-03-15 17:57:39 -04:00
|
|
|
Entity(coordinate _row = 0, coordinate _col = 0);
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
virtual ~Entity() = 0;
|
|
|
|
|
|
|
|
/// Get current Entity position
|
2020-03-15 17:57:39 -04:00
|
|
|
void position(coordinate &row, coordinate &col) const noexcept;
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
/// Set Entity position explicitly
|
2020-03-15 17:57:39 -04:00
|
|
|
void setPosition(coordinate row, coordinate col);
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
/// Get current x of the Entity position
|
2020-03-15 17:57:39 -04:00
|
|
|
coordinate row() const noexcept;
|
2020-03-02 11:04:17 -05:00
|
|
|
|
|
|
|
/// Get current y of the Entity position
|
2020-03-15 17:57:39 -04:00
|
|
|
coordinate col() const noexcept;
|
2020-03-02 11:04:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ENTITY_H
|