2021-05-07 21:36:26 -04:00
|
|
|
#ifndef ACTOR_H
|
|
|
|
#define ACTOR_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <list>
|
2021-05-15 19:44:19 -04:00
|
|
|
#include <set>
|
2021-05-07 21:36:26 -04:00
|
|
|
|
|
|
|
class Location;
|
|
|
|
class Item;
|
|
|
|
|
|
|
|
class Actor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Actor();
|
|
|
|
virtual ~Actor() = 0;
|
|
|
|
|
|
|
|
virtual void commitAction() = 0;
|
|
|
|
virtual void moveToLocation(const std::shared_ptr<Location>& location) = 0;
|
2021-05-15 19:44:19 -04:00
|
|
|
virtual bool isLocationVisited(const std::shared_ptr<Location>& location) const = 0;
|
2021-05-07 21:36:26 -04:00
|
|
|
virtual void giveItem(const std::shared_ptr<Item>& item) = 0;
|
|
|
|
virtual void useItem(const std::shared_ptr<Item>& item) = 0;
|
2021-05-15 19:44:19 -04:00
|
|
|
virtual bool hasItem(const std::shared_ptr<Item>& item) const = 0;
|
2021-05-16 11:20:57 -04:00
|
|
|
virtual void readyItem(const std::shared_ptr<Item>& item) = 0;
|
|
|
|
virtual bool isItemReady(const std::shared_ptr<Item>& item) const = 0;
|
2021-05-07 21:36:26 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
std::shared_ptr<Location> _current_location;
|
|
|
|
std::list<std::shared_ptr<Item>> _inventory;
|
2021-05-16 11:20:57 -04:00
|
|
|
std::shared_ptr<Item> _ready_item;
|
2021-05-15 19:44:19 -04:00
|
|
|
std::set<std::shared_ptr<Location>> _visited_locations;
|
2021-05-07 21:36:26 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ACTOR_H
|