Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
LootObject Class Reference

Represents an object that can be looted. More...

#include <LootObject.hpp>

Inheritance diagram for LootObject:
Inheritance graph
Collaboration diagram for LootObject:
Collaboration graph

Public Member Functions

 LootObject (int id, std::string instanceId, std::string name, Coordinates coords, unsigned int rotation, std::vector< YieldableItem > yieldableItemList, reader::ObjectType type)
 
 LootObject (const LootObjectStruct &object, const ObjectLocation &location, reader::ObjectType objectType)
 
bool canInteract (Entity &entity)
 Check if the entity can interact with the object. More...
 
void interact (Entity &entity)
 Interact with the object. More...
 
- Public Member Functions inherited from Object
 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 CoordinatesgetLocation ()
 Get the location of the object. More...
 
const unsigned int & getRotation ()
 Get the rotation of the object. More...
 
const reader::ObjectTypegetObjectType ()
 Get the ObjectType of object. More...
 

Private Attributes

std::vector< YieldableItemyieldableItemListM
 

Detailed Description

Represents an object that can be looted.

Constructor & Destructor Documentation

◆ LootObject() [1/2]

LootObject::LootObject ( int  id,
std::string  instanceId,
std::string  name,
Coordinates  coords,
unsigned int  rotation,
std::vector< YieldableItem yieldableItemList,
reader::ObjectType  type 
)

◆ LootObject() [2/2]

LootObject::LootObject ( const LootObjectStruct object,
const ObjectLocation location,
reader::ObjectType  objectType 
)

Member Function Documentation

◆ canInteract()

bool LootObject::canInteract ( Entity entity)
virtual

Check if the entity can interact with the object.

Parameters
entitythat interacts with the object.
Returns
True if the entity can interact with the object.

Reimplemented from Object.

Here is the caller graph for this function:

◆ interact()

void LootObject::interact ( Entity entity)
virtual

Interact with the object.

Parameters
entitythat interacts with the object.

Reimplemented from Object.

Here is the call graph for this function:

Member Data Documentation

◆ yieldableItemListM

std::vector<YieldableItem> LootObject::yieldableItemListM
private

The documentation for this class was generated from the following files: