5 #include "../entity/Entity.hpp"
6 #include "RehtiReader.hpp"
74 virtual void interact(
Entity& entity) { std::cout <<
"Cannot interact with this object" << std::endl; };
Base pure virtual Entity class. Different types of enities inherit this.
Definition: Entity.hpp:17
Represents generic object in the game world.
Definition: Object.hpp:12
int idM
Unique id for object type (For example, tree, rock, etc)
Definition: Object.hpp:74
std::string instanceIdM
Unique id for object instance (For example, tree 1, tree at 2 etc)
Definition: Object.hpp:78
virtual ~Object()=default
const std::string & getInstanceId()
Get the instance id of the object.
Definition: Object.cpp:18
std::string nameM
Definition: Object.hpp:79
const reader::ObjectType & getObjectType()
Get the ObjectType of object.
Definition: Object.cpp:38
Coordinates coordinatesM
Definition: Object.hpp:80
const Coordinates & getLocation()
Get the location of the object.
Definition: Object.cpp:28
unsigned int rotationM
Definition: Object.hpp:81
const int & getId()
Get the id of the object.
Definition: Object.cpp:13
virtual bool canInteract(Entity &entity)
Check if the object can be interacted with by a entity. There might be several reason for not being a...
Definition: Object.hpp:68
const std::string & getName()
Get the name of the object.
Definition: Object.cpp:23
Object(int id, std::string instanceId, std::string name, Coordinates coordinates, unsigned int rotation, reader::ObjectType objectType)
Definition: Object.cpp:3
virtual void interact(Entity &entity)
Interact with the object.
Definition: Object.hpp:74
const unsigned int & getRotation()
Get the rotation of the object.
Definition: Object.cpp:33
reader::ObjectType objectTypeM
Definition: Object.hpp:82
ObjectType
Definition: ObjectReader.hpp:90
Struct for coordinates.
Definition: Coordinates.hpp:7
Definition: ObjectReader.hpp:42
Describes the location of an object on the map. This is used to spawn object instances on the map.
Definition: ObjectReader.hpp:17