cirno-puzzle/include/entity.h

31 lines
679 B
C
Raw Normal View History

#ifndef ENTITY_H
#define ENTITY_H
2020-03-15 17:57:39 -04:00
using coordinate = unsigned long;
/// 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;
public:
2020-03-15 17:57:39 -04:00
Entity(coordinate _row = 0, coordinate _col = 0);
virtual ~Entity() = 0;
/// Get current Entity position
2020-03-15 17:57:39 -04:00
void position(coordinate &row, coordinate &col) const noexcept;
/// Set Entity position explicitly
2020-03-15 17:57:39 -04:00
void setPosition(coordinate row, coordinate col);
/// Get current x of the Entity position
2020-03-15 17:57:39 -04:00
coordinate row() const noexcept;
/// Get current y of the Entity position
2020-03-15 17:57:39 -04:00
coordinate col() const noexcept;
};
#endif // ENTITY_H