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

Represents and object that can be interacted with to gain resources and train skills. More...

#include <ResourceObject.hpp>

Inheritance diagram for ResourceObject:
Inheritance graph
Collaboration diagram for ResourceObject:
Collaboration graph

Public Member Functions

 ResourceObject (int id, std::string instanceId, std::string name, Coordinates coords, unsigned int rotation, std::vector< YieldableItem > yieldableItemList, int xpPerYield, int depleteChance, int relatedSkillId, int xpRequirement, reader::ObjectType type, std::vector< ItemTransform > itemTransformList)
 
 ResourceObject (const ResourceObjectStruct &object, const ObjectLocation &location, reader::ObjectType type)
 
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
 
int xpPerYieldM
 
int depleteChanceM
 TODO: Deplete functionality. More...
 
std::vector< ItemTransformitemTransformListM
 
int relatedSkillIdM
 
int xpRequirementM
 

Detailed Description

Represents and object that can be interacted with to gain resources and train skills.

Constructor & Destructor Documentation

◆ ResourceObject() [1/2]

ResourceObject::ResourceObject ( int  id,
std::string  instanceId,
std::string  name,
Coordinates  coords,
unsigned int  rotation,
std::vector< YieldableItem yieldableItemList,
int  xpPerYield,
int  depleteChance,
int  relatedSkillId,
int  xpRequirement,
reader::ObjectType  type,
std::vector< ItemTransform itemTransformList 
)

◆ ResourceObject() [2/2]

ResourceObject::ResourceObject ( const ResourceObjectStruct object,
const ObjectLocation location,
reader::ObjectType  type 
)

Member Function Documentation

◆ canInteract()

bool ResourceObject::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, false otherwise.

Reimplemented from Object.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interact()

void ResourceObject::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

◆ depleteChanceM

int ResourceObject::depleteChanceM
private

TODO: Deplete functionality.

◆ itemTransformListM

std::vector<ItemTransform> ResourceObject::itemTransformListM
private

◆ relatedSkillIdM

int ResourceObject::relatedSkillIdM
private

◆ xpPerYieldM

int ResourceObject::xpPerYieldM
private

◆ xpRequirementM

int ResourceObject::xpRequirementM
private

◆ yieldableItemListM

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

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