|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
Represents generic object in the game world. More...
#include <Object.hpp>


Public Member Functions | |
| Object (int id, std::string instanceId, std::string name, Coordinates coordinates, unsigned int rotation, reader::ObjectType objectType) | |
| Object (const GeneralObjectStruct &object, const ObjectLocation &location, reader::ObjectType objectType) | |
| virtual | ~Object ()=default |
| const int & | getId () |
| Get the id of the object. More... | |
| const std::string & | getInstanceId () |
| Get the instance id of the object. More... | |
| const std::string & | getName () |
| Get the name of the object. More... | |
| const Coordinates & | getLocation () |
| Get the location of the object. More... | |
| const unsigned int & | getRotation () |
| Get the rotation of the object. More... | |
| const reader::ObjectType & | getObjectType () |
| Get the ObjectType of object. More... | |
| virtual bool | canInteract (Entity &entity) |
| Check if the object can be interacted with by a entity. There might be several reason for not being able to interact with an object (inventory full, not enought xp etc. ) More... | |
| virtual void | interact (Entity &entity) |
| Interact with the object. More... | |
Private Attributes | |
| int | idM |
| Unique id for object type (For example, tree, rock, etc) More... | |
| std::string | instanceIdM |
| Unique id for object instance (For example, tree 1, tree at 2 etc) More... | |
| std::string | nameM |
| Coordinates | coordinatesM |
| unsigned int | rotationM |
| reader::ObjectType | objectTypeM |
Represents generic object in the game world.
| Object::Object | ( | int | id, |
| std::string | instanceId, | ||
| std::string | name, | ||
| Coordinates | coordinates, | ||
| unsigned int | rotation, | ||
| reader::ObjectType | objectType | ||
| ) |
| Object::Object | ( | const GeneralObjectStruct & | object, |
| const ObjectLocation & | location, | ||
| reader::ObjectType | objectType | ||
| ) |
|
virtualdefault |
|
inlinevirtual |
Check if the object can be interacted with by a entity. There might be several reason for not being able to interact with an object (inventory full, not enought xp etc. )
| entity | that interacts with the object. |
Reimplemented in ResourceObject, and LootObject.
| const int & Object::getId | ( | ) |
Get the id of the object.
| const std::string & Object::getInstanceId | ( | ) |
Get the instance id of the object.
| const Coordinates & Object::getLocation | ( | ) |
Get the location of the object.
| const std::string & Object::getName | ( | ) |
Get the name of the object.

| const reader::ObjectType & Object::getObjectType | ( | ) |
Get the ObjectType of object.
| const unsigned int & Object::getRotation | ( | ) |
Get the rotation of the object.
|
inlinevirtual |
Interact with the object.
| entity | that interacts with the object. |
Reimplemented in ResourceObject, and LootObject.
|
private |
|
private |
Unique id for object type (For example, tree, rock, etc)
|
private |
Unique id for object instance (For example, tree 1, tree at 2 etc)
|
private |
|
private |
|
private |