WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Mythology.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_MYTHOLOGY_HPP
3 #define WORLDSIM_MYTHOLOGY_HPP
4 
5 /* WorldSim: Mythology
6  #include "Mythology.hpp"
7 
8  Container for mythology of a group of Characters.
9 
10  Each Civ may have a "State Mythology", however each Character can choose their own.
11 */
12 
13 
14 
15 
16 
17 
18 // The saints of the world (notable mortal characters). Maybe prophet as well.
19 // It is not required that the saint/prophet be genuine. False prophets can be included.
21 {
22  public:
23 };
24 
25 // should inherit event class (for legends interface)
26 // Types of events:
27 
28 // World created - exceptional event of course
29 // create race - create one of the races
30 // Artifact created - deity made a special artifact
31 // Commandment - deity gave a commandment to its people (aka a law they must follow)
32 // Terrain modification
33 // Disaster or other large scale event
34 // Interaction between multiple deities
35 // Tech provided
36 // Character posessed by a deity
37 // Structure created
38 // Beast created
39 
41 {
42  public:
43 
44  std::string date; // date of event.
45  std::string type; // category of event, for example creation. (should be enum)
46  std::string description; // description of event for legends menu
47 
48 };
49 
50 
51 class World;
52 #include "Mythology_Deity.hpp"
53 #include <Container/Table/TableInterface.hpp>
54 
55 // changes should be made by gradual steps, like government in a Paradox game
56 // at least for now, the initial creation myth should be hardcoded. Only later details should mutate.
57 class Mythology: public TableInterface
58 {
59  private:
60 
61  Vector <Mythology*> vChildMythology; // Mythologies derived from this one.
62 
63  Vector <Mythology_Deity*> vDeity;
64  Vector <Mythology_Event*> vEvent; // List of events which happened in this Mythology.
65 
66  protected:
67 
69 
70  public:
71 
72  std::string name; // what the mythology calls itself
73 
74  enum mythology_type { MYTHOLOGY_NONE, MYTHOLOGY_SPIRITUAL, MYTHOLOGY_MONOTHEISTIC, MYTHOLOGY_POLYTHEISTIC, MYTHOLOGY_PAGAN };
75  mythology_type type; // The base type of mythology.
76  // the race which created the mythology. Other races can still follow it.
77  enumRace race; // The base type of mythology.
78 
79 
80  // Name of the World. For now hardcoded.
81 
82  // Name of creator deity/deities. For now divided into limited sets.
83 
84  // Sub-deities - Maybe we can make this freeform.
85  // Mythological stories - The deities and sub-deities interact.
86 
87  Mythology();
88 
89  // generate the base mythology
90  void generateBase();
91 
92  void generateBaseDwarven();
93  void generateBaseElven();
94  void generateBaseHuman();
95 
96  void addDeity(std::string /* _name */, Mythology_Deity::PERSONALITY /* _type */ );
97 
98  // do some stuff
99  void increment();
100 
101  std::string getType();
102  std::string getDescription();
103 
104  std::string getColumn(std::string _column) override;
105  std::string getColumnType(std::string _column) override;
106 
107  virtual std::string getLongDescription();
108 
109 };
110 
112 {
113  public:
114  Vector <Mythology*> vMythology;
115 
117  {
118  }
119 
120  void add(Mythology* _mythology)
121  {
122  vMythology.add(_mythology);
123  }
124 
125  Mythology* get(int i)
126  {
127  if (vMythology.isSafe(i))
128  {
129  return vMythology(i);
130  }
131  return 0;
132  }
133 
134  int size()
135  {
136  return vMythology.size();
137  }
138 
139  void init()
140  {
141  }
142 };
144 
145 // Dwarven and Elven mythology are to be mostly hardcoded and not too subject to change.
146 
148 {
149  public:
150 
152  {
154  race = DWARVEN;
155  name = "Dwarven mythology";
156 
157  Mythology_Deity* deity = new Mythology_Deity();
158  deity->name = globalNameGen.generate();
159  }
160 
161  std::string getLongDescription()
162  {
163  std::string description = "The Dwarven religion is monotheistic, believing in a single Architect God who "
164  "designed the universe according to mathematical laws. The Architect generally does not concern itself with "
165  "human affairs, but may sometimes provide assistance to a particularly gifted individual in the form of madness. "
166  "The main goal of their religion is to elevate themselves beyond their mortality, using knowledge and technology "
167  "to do so.";
168  return description;
169  }
170 };
171 
173 
174 #endif
175 
Definition: Mythology.hpp:74
std::string name
Definition: Mythology.hpp:72
std::string description
Definition: Mythology.hpp:46
Vector< Mythology * > vMythology
Definition: Mythology.hpp:114
Definition: Mythology.hpp:20
Definition: World.hpp:50
Definition: Mythology.hpp:147
int size()
Definition: Mythology.hpp:134
std::string getLongDescription()
Definition: Mythology.hpp:161
Definition: Driver_Settings_Enums.hpp:45
Mythology_Dwarven()
Definition: Mythology.hpp:151
NameGenerator globalNameGen
Definition: Driver_GlobalObjects.hpp:22
PERSONALITY
Definition: Mythology_Deity.hpp:20
enumRace
Definition: Driver_Settings_Enums.hpp:41
Mythology_Dwarven mythologyDwarven
Definition: Mythology.hpp:172
mythology_type type
Definition: Mythology.hpp:75
enumRace race
Definition: Mythology.hpp:77
void add(Mythology *_mythology)
Definition: Mythology.hpp:120
std::string date
Definition: Mythology.hpp:44
std::string type
Definition: Mythology.hpp:45
World * world
Definition: Mythology.hpp:68
Definition: Mythology.hpp:40
Definition: Mythology.hpp:111
Mythology_Manager()
Definition: Mythology.hpp:116
std::string name
Definition: Mythology_Deity.hpp:18
Definition: Mythology_Deity.hpp:15
void init()
Definition: Mythology.hpp:139
Definition: Mythology.hpp:57
Mythology_Manager mythologyManager
Definition: Mythology.hpp:143
mythology_type
Definition: Mythology.hpp:74