WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Static.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_STATIC_HPP
3 #define WORLDSIM_STATIC_HPP
4 
5 /* WorldSim: Static
6  #include "Static.hpp" */
7 
24 class Static: public HasTexture
25 {
26  public:
27  std::string name;
28  unsigned char blockMove; // bitfield blocks movement in direction starting NW and going clockwise
29  unsigned char blockLOS; // bitfield blocks LOS in direction starting NW and going clockwise
30 
31  unsigned char id; // local id from 1-255 for loading/saving/abstraction
32 
33  // HP
34  // DAMAGE RESIST
35 
37  {
38  blockMove=0;
39  blockLOS=0;
40  id=0;
41  }
42 
43  virtual std::string getName()
44  {
45  return name;
46  }
47 
48  // OBJECT INTERACTION
49  // In future these functions might need to be expanded to return multiple possibilities, for example
50  // "Stab target" and "Slash target". Or "Chop down door" and "Pry open door".
51  // The good thing about this approach is that it can list out all possible interactions between objects,
52  // which I think is better than making the player guess what everything does.
53  // There are different types of objects, such as Items, WorldObjects and LocalTiles.
54  virtual void interact (WorldObject* obj, int interactionType=0)
55  {
56  std::cout<<"The "<<getName()<<" interacts with the "<<obj->getName()<<".\n";
57  }
58  // virtual void interact (LocalTile* obj, int interactionType=0)
59  // {
60  // std::cout<<"The "<<getName()<<" interacts with the "<<obj->getName()<<".\n";
61  // }
62  // virtual void interact (Item* obj, int interactionType=0)
63  // {
64  // std::cout<<"The "<<getName()<<" interacts with the "<<obj->getName()<<".\n";
65  // }
66  // virtual void interact (Character* obj, int interactionType=0)
67  // {
68  // std::cout<<"Char interact\n";
69  // //std::cout<<"The "<<getName()<<" interacts with the "<<obj->getName()<<".\n";
70  // }
71  // virtual void interact (Creature* obj, int interactionType=0)
72  // {
73  // std::cout<<"Creature interact\n";
74  // //std::cout<<"The "<<getName()<<" interacts with the "<<obj->getName()<<".\n";
75  // }
76 
77  /* HASTEXTURE */
78  virtual Texture* currentTexture()
79  {
80  return 0;
81  }
82 };
83 
84 // object capable of holding Ingredients
86 {
87  public:
88 };
89 
90 #endif
std::string name
Definition: Static.hpp:27
unsigned char blockMove
Definition: Static.hpp:28
Definition: WorldObject.hpp:18
virtual std::string getName()
Definition: Static.hpp:43
Definition: Static.hpp:24
virtual Texture * currentTexture()
Definition: Static.hpp:78
unsigned char blockLOS
Definition: Static.hpp:29
virtual std::string getName()
Definition: WorldObject.cpp:32
virtual void interact(WorldObject *obj, int interactionType=0)
Definition: Static.hpp:54
unsigned char id
Definition: Static.hpp:31
Static()
Definition: Static.hpp:36
Definition: Static.hpp:85