Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
LootObject.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 #include <vector>
5 
6 #include "Object.hpp"
7 
11 class LootObject : public Object
12 {
13 public:
14  LootObject(int id, std::string instanceId, std::string name, Coordinates coords, unsigned int rotation, std::vector<YieldableItem> yieldableItemList, reader::ObjectType type);
15 
16  LootObject(const LootObjectStruct& object, const ObjectLocation& location, reader::ObjectType objectType);
17 
23  bool canInteract(Entity& entity);
24 
29  void interact(Entity& entity);
30 
31 private:
32  std::vector<YieldableItem> yieldableItemListM;
33 };
Base pure virtual Entity class. Different types of enities inherit this.
Definition: Entity.hpp:17
Represents an object that can be looted.
Definition: LootObject.hpp:12
void interact(Entity &entity)
Interact with the object.
Definition: LootObject.cpp:20
LootObject(int id, std::string instanceId, std::string name, Coordinates coords, unsigned int rotation, std::vector< YieldableItem > yieldableItemList, reader::ObjectType type)
Definition: LootObject.cpp:4
std::vector< YieldableItem > yieldableItemListM
Definition: LootObject.hpp:32
bool canInteract(Entity &entity)
Check if the entity can interact with the object.
Definition: LootObject.cpp:14
Represents generic object in the game world.
Definition: Object.hpp:12
ObjectType
Definition: ObjectReader.hpp:90
Struct for coordinates.
Definition: Coordinates.hpp:7
Definition: ObjectReader.hpp:82
Describes the location of an object on the map. This is used to spawn object instances on the map.
Definition: ObjectReader.hpp:17