Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
CharacterReader.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
10 {
11  int xMin;
12  int xMax;
13  int yMin;
14  int yMax;
15 };
16 
20 const struct
21 {
22  const std::string Passive = "PASSIVE";
23  const std::string Aggressive = "AGGRESSIVE";
24  const std::string Peaceful = "PEACEFUL";
26 
30 struct PlayerData
31 {
32  int id;
33  std::string textureFilename;
34  std::string glTFFilename;
38 };
39 
43 struct NPCData
44 {
45  int id;
46  std::string name;
47  std::string textureFilename;
48  std::string glTFFilename;
51  std::string agressionType;
55  std::vector<std::string> chatResponses;
56 };
57 
62 {
64  std::vector<NPCData> npcs;
65 };
66 
72 
79 void validSpawnCoordinateBounds(SpawnCoordinateBounds spawnCoordinateBounds, int worldWidth, int worldHeight);
const std::string Aggressive
Definition: CharacterReader.hpp:23
GameCharacters readCharacterData()
Reads the character data from JSON file.
Definition: CharacterReader.cpp:7
void validSpawnCoordinateBounds(SpawnCoordinateBounds spawnCoordinateBounds, int worldWidth, int worldHeight)
Check if SpawnCoordinateBounds is valid. Throws error if not.
Definition: CharacterReader.cpp:119
const std::string Peaceful
Definition: CharacterReader.hpp:24
const struct @0 AggressionType
Has all the possible NPCData aggression types as strings.
const std::string Passive
Definition: CharacterReader.hpp:22
Contains all the character data. This is used to load character assets into memory and spawn characte...
Definition: CharacterReader.hpp:62
PlayerData player
Definition: CharacterReader.hpp:63
std::vector< NPCData > npcs
Definition: CharacterReader.hpp:64
Contains all the NPCData data. This is used to load NPCData assets into memory and spawn NPCs on the ...
Definition: CharacterReader.hpp:44
int agressionRange
Definition: CharacterReader.hpp:52
std::vector< std::string > chatResponses
Definition: CharacterReader.hpp:55
int baseDamage
Definition: CharacterReader.hpp:53
int id
Definition: CharacterReader.hpp:45
std::string textureFilename
Definition: CharacterReader.hpp:47
int spawnAmount
Definition: CharacterReader.hpp:50
std::string name
Definition: CharacterReader.hpp:46
SpawnCoordinateBounds spawnCoordinateBounds
Definition: CharacterReader.hpp:49
int baseAccuracy
Definition: CharacterReader.hpp:54
std::string agressionType
Definition: CharacterReader.hpp:51
std::string glTFFilename
Definition: CharacterReader.hpp:48
Contains all the player data. This is used to load player assets into memory and spawn players on the...
Definition: CharacterReader.hpp:31
int id
Definition: CharacterReader.hpp:32
int baseDamage
Definition: CharacterReader.hpp:36
int baseAccuracy
Definition: CharacterReader.hpp:37
std::string textureFilename
Definition: CharacterReader.hpp:33
std::string glTFFilename
Definition: CharacterReader.hpp:34
SpawnCoordinateBounds spawnCoordinateBounds
Definition: CharacterReader.hpp:35
Contains the spawn coordinate bounds for a character.
Definition: CharacterReader.hpp:10
int xMin
Definition: CharacterReader.hpp:11
int yMax
Definition: CharacterReader.hpp:14
int yMin
Definition: CharacterReader.hpp:13
int xMax
Definition: CharacterReader.hpp:12