WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Creature_Knowledge.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_CREATURE_KNOWLEDGE_HPP
3 #define WORLDSIM_CREATURE_KNOWLEDGE_HPP
4 
5 /* WorldSim: Creature_Knowledge
6  #include "Creature_Knowledge.hpp"
7 
8  Creatures will be able to have some limited understanding of the world when they are loaded in.
9  However it will be more limited compared to Characters.
10 */
11 
12 #include <Interface/HasXY.hpp>
13 
14 #include "Pathing.hpp"
15 
17 {
18  public:
20 
21  unsigned int pathIndex;
22 
23 
24 
25  // Vector of places this Character has visited. I think most characters will only visit a handful of maps.
26  //Vector <World_Local*> vMapsVisited;
27  //Vector < ArrayS2 <char>* > vaTileVisited;
28 
29  Vector <HasXY*> vVisitedTiles; /* List of coordinates the Creature has stood on. */
30 
31  Vector <LocalTile*> vVisibleTiles;
32 
33  HasXY currentGoal; /* Creatures can wander by moving toward a particular waypoint */
34  HasXY threatLocation; /* Creature should avoid this location */
35 
36  /* INITIALIZATION */
38  void init();
39 
40 
41  // Add this tile into the Character's knowledge (if it isn't already)
42  void addTile( World_Local* /* _map */, int /* _x */, int /* _y */ );
43 
44  //returns true if the Character has seen this tile. 0 = no. 1 = has seen. 2 = currently visible.
45  char hasSeen( World_Local* /* _map */, int /* _x */, int /* _y */ );
46 
47 
48 
49  void updateThreat(short int threatX, short int threatY);
50 
51  // Sets all 2 to 1 for LOS update.
52  void updateLOS();
53  // Forget all knowledge
54  void clear();
55 
56  // Return next step from path. NESW. 0 if no path.
57  char nextStep();
58 
59  //returns true if the Character can currently see this tile.
60  //bool canSee( World_Local* /* _map */, int /* _x */, int /* _y */ );
61 };
62 
63 #endif
Vector< LocalTile * > vVisibleTiles
Definition: Creature_Knowledge.hpp:31
HasXY currentGoal
Definition: Creature_Knowledge.hpp:33
HasXY threatLocation
Definition: Creature_Knowledge.hpp:34
void addTile(World_Local *, int, int)
Definition: Creature_Knowledge.cpp:25
Definition: Pathing.hpp:18
Creature_Knowledge()
Definition: Creature_Knowledge.cpp:13
void clear()
Definition: Creature_Knowledge.cpp:60
Definition: World_Local.hpp:58
Vector< HasXY * > vVisitedTiles
Definition: Creature_Knowledge.hpp:29
void updateThreat(short int threatX, short int threatY)
Definition: Creature_Knowledge.cpp:33
void updateLOS()
Definition: Creature_Knowledge.cpp:55
unsigned int pathIndex
Definition: Creature_Knowledge.hpp:21
char nextStep()
Definition: Creature_Knowledge.cpp:67
void init()
Definition: Creature_Knowledge.cpp:18
Pathing_Local p
Definition: Creature_Knowledge.hpp:19
char hasSeen(World_Local *, int, int)
Definition: Creature_Knowledge.cpp:39
Definition: Creature_Knowledge.hpp:16