C++ Joueur Client
 All Classes Namespaces Functions Variables
cowboy.hpp
1 #ifndef GAMES_SALOON_COWBOY_H
2 #define GAMES_SALOON_COWBOY_H
3 
4 // Cowboy
5 // A person on the map that can move around and interact within the saloon.
6 
7 // DO NOT MODIFY THIS FILE
8 // Never try to directly create an instance of this class, or modify its member variables.
9 // Instead, you should only be reading its variables and calling its functions.
10 
11 #include <vector>
12 #include <queue>
13 #include <deque>
14 #include <unordered_map>
15 #include <string>
16 #include <initializer_list>
17 
18 #include "../../joueur/src/any.hpp"
19 
20 #include "game_object.hpp"
21 
22 #include "impl/saloon_fwd.hpp"
23 
24 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
25 // you can add additional #includes here
26 // <<-- /Creer-Merge: includes -->>
27 
28 namespace cpp_client
29 {
30 
31 namespace saloon
32 {
33 
37 class Cowboy : public Game_object
38 {
39 public:
40 
44  const bool& can_move;
45 
49  const std::string& drunk_direction;
50 
54  const int& focus;
55 
59  const int& health;
60 
64  const bool& is_dead;
65 
69  const bool& is_drunk;
70 
74  const std::string& job;
75 
79  const Player& owner;
80 
84  const Tile& tile;
85 
89  const int& tolerance;
90 
94  const int& turns_busy;
95 
96  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
97  // You can add additional member variables here. None of them will be tracked or updated by the server.
98  // <<-- /Creer-Merge: member variables -->>
99 
100 
106  bool act(const Tile& tile, const std::string& drunk_direction = "");
107 
112  bool move(const Tile& tile);
113 
118  bool play(const Furnishing& piano);
119 
120 
121  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
122  // You can add additional methods here.
123  // <<-- /Creer-Merge: methods -->>
124 
125  ~Cowboy_();
126 
127  // ####################
128  // Don't edit these!
129  // ####################
131  Cowboy_(std::initializer_list<std::pair<std::string, Any&&>> init);
132  Cowboy_() : Cowboy_({}){}
133  virtual void resize(const std::string& name, std::size_t size) override;
134  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
135  virtual void remove_key(const std::string& name, Any& key) override;
136  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
137  virtual bool is_map(const std::string& name) override;
138  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
140  // ####################
141  // Don't edit these!
142  // ####################
143 };
144 
145 } // saloon
146 
147 } // cpp_client
148 
149 #endif // GAMES_SALOON_COWBOY_H
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
bool act(const Tile &tile, const std::string &drunk_direction="")
does their job's action on a _tile.
A person on the map that can move around and interact within the saloon.
Definition: cowboy.hpp:37
const Player & owner
The Player that owns and can control this Cowboy.
Definition: cowboy.hpp:79
bool play(const Furnishing &piano)
sits down and plays a piano.
const int & health
How much health this Cowboy currently has.
Definition: cowboy.hpp:59
const int & turns_busy
How many turns this unit has remaining before it is no longer busy and can act() or play() again...
Definition: cowboy.hpp:94
const bool & is_drunk
If this Cowboy is drunk, and will automatically walk.
Definition: cowboy.hpp:69
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
bool move(const Tile &tile)
moves this _cowboy from its current _tile to an adjacent _tile.
const bool & is_dead
If this Cowboy is dead and has been removed from the game.
Definition: cowboy.hpp:64
const Tile & tile
The Tile that this Cowboy is located on.
Definition: cowboy.hpp:84
const std::string & drunk_direction
The direction this Cowboy is moving while drunk. Will be 'North', 'East', 'South', or 'West' when drunk; or '' (empty string) when not drunk.
Definition: cowboy.hpp:49
const std::string & job
The job that this Cowboy does, and dictates how they fight and interact within the Saloon...
Definition: cowboy.hpp:74
const bool & can_move
If the Cowboy can be moved this turn via its owner.
Definition: cowboy.hpp:44
An furnishing in the Saloon that must be pathed around, or destroyed.
Definition: furnishing.hpp:37
const int & focus
How much focus this Cowboy has. Different Jobs do different things with their Cowboy's focus...
Definition: cowboy.hpp:54
const int & tolerance
How many times this unit has been drunk before taking their siesta and resetting this to 0...
Definition: cowboy.hpp:89
A player in this game. Every AI controls one player.
Definition: player.hpp:37