WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Creature_Generator.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_CREATURE_GENERATOR_HPP
3 #define WORLDSIM_CREATURE_GENERATOR_HPP
4 
5 /* WorldSim: Creature_Generator
6  #include "Creature_Generator.hpp"
7 
8  Class to generate new Creature_Species.
9 */
10 
11 class Creature_Species;
12 
13 #include <Container/WordList/WordList.hpp>
14 
16 {
17  // It might be better practise to have a more centralised name generator which can handle all the different
18  // names to generate, for example Flora, cities, people, etc. However there is still a lot to implement here
19  // eg alchemy effects, before I'll look at doing that.
20 
21  //All these should become raws tbh
22  WordList wlistFloraPattern;
23  WordList wlistFloraColour;
24  WordList wlistFloraAdjective;
25  WordList wlistFloraNoun;
26  // For testing
27  WordList wlistCreatureType;
28 
29  // species templates from which to spin off creatures.
30  Vector <Creature_Species*> vSpecies;
31 
32  public:
34 
35  // load the raws data from raw file
36  void loadRaw(std::string strRaw);
37 
38  std::string generateName();
39 
40  // Flora generation.
41  // Name is randomly generated from wordlists.
42  // Current system makes each additional Flora half as common as the previous.
43  Vector <Creature_Species*> * generate(int amount);
44 
45  // generate and return a single creature type
46  // note this is Flora type, not object.
47  Creature_Species * get(const int spawnWeighting=0);
48 };
49 
50 #endif
Definition: Creature_Generator.hpp:15
Vector< Creature_Species * > * generate(int amount)
Definition: Creature_Generator.cpp:109
Definition: Creature_Species.hpp:23
void loadRaw(std::string strRaw)
Definition: Creature_Generator.cpp:38
std::string generateName()
Definition: Creature_Generator.cpp:79
Creature_Generator()
Definition: Creature_Generator.cpp:21