WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Character_Knowledge.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_CHARACTER_KNOWLEDGE_HPP
3 #define WORLDSIM_CHARACTER_KNOWLEDGE_HPP
4 
5 /* WorldSim: Character_Knowledge
6 #include "Character_Knowledge.hpp"
7 
8 Characters will use a knowledge object to store their understanding of the world.
9 Currently this will consist of explored tiles for line of sight and fog of war.
10 */
11 
12 #include "Pathing.hpp"
13 
15 {
16  public:
18 
19  // Vector of places this Character has visited. I think most characters will only visit a handful of maps.
20  Vector <World_Local*> vMapsVisited;
21  Vector < ArrayS2 <char>* > vaTileVisited;
22 
23  // Same but for subterranean tiles
24  Vector <World_Local*> vSubMapsVisited;
25  Vector < ArrayS2 <char>* > vaSubTileVisited;
26 
27  Vector <char> vPath; // current path
28 
29  HasXY currentGoal; /* Characters can wander by moving toward a particular waypoint */
30 
31 
32  /* INITIALIZATION */
34  // Initialise, including roll for stats. 0 - Roll gender. 1 - Male. 2 - Female.
35  void init();
36 
37 
38  // Add this tile into the Character's knowledge (if it isn't already)
39  void addTile( World_Local* /* _map */, int /* _x */, int /* _y */, bool isSubterranean = false);
40 
41  // Adds the tile to the Character's knowledge.
42  // Overloaded to allow absolute coordinates.
43  void addTile( unsigned long int /* _x */, unsigned long int /* _y */, bool isSubterranean = false);
44 
45  //returns true if the Character has seen this tile. 0 = no. 1 = has seen. 2 = currently visible.
46  char hasSeen( World_Local* /* _map */, int /* _x */, int /* _y */, bool isSubterranean = false);
47 
48 
49  // Sets all 2 to 1 for LOS update.
50  void updateLOS();
51 
52  //returns true if the Character can currently see this tile.
53  //bool canSee( World_Local* /* _map */, int /* _x */, int /* _y */ );
54 };
55 
56 #endif // WORLDSIM_CHARACTER_KNOWLEDGE_HPP
Vector< ArrayS2< char > *> vaTileVisited
Definition: Character_Knowledge.hpp:21
HasXY currentGoal
Definition: Character_Knowledge.hpp:29
Vector< char > vPath
Definition: Character_Knowledge.hpp:27
void addTile(World_Local *, int, int, bool isSubterranean=false)
Definition: Character_Knowledge.cpp:24
char hasSeen(World_Local *, int, int, bool isSubterranean=false)
Definition: Character_Knowledge.cpp:142
Definition: Pathing.hpp:18
Definition: World_Local.hpp:58
Pathing_Local p
Definition: Character_Knowledge.hpp:17
Vector< World_Local * > vMapsVisited
Definition: Character_Knowledge.hpp:20
Vector< World_Local * > vSubMapsVisited
Definition: Character_Knowledge.hpp:24
void init()
Definition: Character_Knowledge.cpp:18
Vector< ArrayS2< char > *> vaSubTileVisited
Definition: Character_Knowledge.hpp:25
Definition: Character_Knowledge.hpp:14
void updateLOS()
Definition: Character_Knowledge.cpp:169
Character_Knowledge()
Definition: Character_Knowledge.cpp:13