WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Idea.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_IDEA_HPP
3 #define WORLDSIM_IDEA_HPP
4 
5 /* WorldSim: Idea.hpp
6  #include "Idea.hpp"
7 
8  An Idea is a precursor to Technology. A Character will have an idea about how to improve something. Once it spreads
9  to the leader or a book is written about it, it will become established as a technology. The originator of the idea
10  will be the one credited.
11 
12  Ideas will later cover more than technology.
13 
14 */
15 
16 class Character;
17 
18 class Idea
19 {
20 public:
21  static int lastID; // Static variable to keep track of the last assigned ID
22  int id;
25 
26  enum IDEA_TYPE
27  {
28  IDEA_NONE, // error flag
36  };
37 
39 
40  Idea(Character* _originator, IDEA_TYPE _type);
41  Idea(const Idea& other);
42  Idea& operator=(const Idea& other);
43  bool operator==(const Idea& other) const;
44  std::string ideaToString(IDEA_TYPE idea);
45 };
46 
47 
48 
49 class SpecialIdea: public Idea
50 {
51  public:
52  enum TYPE
53  {
56  };
57 
58  std::string biographyText;
60  std::string discoveryText();
61 };
62 
63 #endif // WORLDSIM_IDEA_HPP
static int lastID
Definition: Idea.hpp:21
bool isSpecialIdea
Definition: Idea.hpp:24
Definition: Idea.hpp:30
Definition: Idea.hpp:31
std::string ideaToString(IDEA_TYPE idea)
Definition: Idea.cpp:50
Definition: Idea.hpp:32
Definition: Idea.hpp:35
Character * originator
Definition: Idea.hpp:23
Definition: Idea.hpp:54
std::string biographyText
Definition: Idea.hpp:58
Definition: Idea.hpp:34
int id
Definition: Idea.hpp:22
Idea & operator=(const Idea &other)
Definition: Idea.cpp:34
Definition: Character.hpp:38
Definition: Idea.hpp:49
Definition: Idea.hpp:33
TYPE
Definition: Idea.hpp:52
Definition: Idea.hpp:28
Definition: Idea.hpp:18
bool operator==(const Idea &other) const
Definition: Idea.cpp:45
IDEA_TYPE
Definition: Idea.hpp:26
IDEA_TYPE type
Definition: Idea.hpp:38
Idea(Character *_originator, IDEA_TYPE _type)
Definition: Idea.cpp:22
Definition: Idea.hpp:29