Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
ObjectReader.hpp File Reference
#include <fstream>
#include <iostream>
#include <map>
#include <optional>
#include <string>
#include "ItemReader.hpp"
#include "SkillReader.hpp"
#include "Utils.hpp"
Include dependency graph for ObjectReader.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ObjectLocation
 Describes the location of an object on the map. This is used to spawn object instances on the map. More...
 
struct  GeneralObjectStruct
 
struct  YieldableItem
 
struct  YieldableItems
 
struct  ItemTransform
 
struct  ResourceObjectStruct
 
struct  LootObjectStruct
 
struct  GameObjects
 Contains all the objects defined in the objects.json file. More...
 

Namespaces

 reader
 

Enumerations

enum class  reader::ObjectType { reader::GENERAL , reader::RESOURCE , reader::LOOT }
 

Functions

std::string generateObjectInstanceId (ObjectLocation objectLocation)
 Generates a unique id for an object instance. More...
 
const std::vector< ObjectLocationreadObjectLocations ()
 Reads all the objects on the map. Server can use this to spawn objects on the map. More...
 
GameObjects fetchObjects (GameItems &gameItems, std::map< int, GameSkill > &gameSkills)
 Reads objects defined in the objects.json file and returns them as a GameObjects struct. More...
 

Function Documentation

◆ fetchObjects()

GameObjects fetchObjects ( GameItems gameItems,
std::map< int, GameSkill > &  gameSkills 
)

Reads objects defined in the objects.json file and returns them as a GameObjects struct.

Parameters
gameItemsGameItems
gameSkillsGameSkills
Returns
GameObjects
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateObjectInstanceId()

std::string generateObjectInstanceId ( ObjectLocation  objectLocation)

Generates a unique id for an object instance.

Parameters
objectLocationObjectLocation
Returns
unique id string
Here is the caller graph for this function:

◆ readObjectLocations()

const std::vector<ObjectLocation> readObjectLocations ( )

Reads all the objects on the map. Server can use this to spawn objects on the map.

Returns
List of ObjectLocation structs
Here is the call graph for this function:
Here is the caller graph for this function: