Symphony Of Empires
economy.hpp
Go to the documentation of this file.
1 // Symphony of Empires
2 // Copyright (C) 2021, Symphony of Empires contributors
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 //
17 // ----------------------------------------------------------------------------
18 // Name:
19 // server/economy.hpp
20 //
21 // Abstract:
22 // Does some important stuff.
23 // ----------------------------------------------------------------------------
24 
25 #pragma once
26 
27 #include "server/trade.hpp"
28 
29 class World;
30 
31 // Functions that do a economy simulation in various steps, divided to reduce
32 // overhead, they are distributed accross 48 ticks
33 namespace Economy {
34  struct Market {
36  std::vector<float> price;
37  std::vector<float> supply;
38  std::vector<float> demand;
39  std::vector<float> global_demand;
40  };
41 
42  struct EconomyState final {
44  std::vector<Market> commodity_market;
45  };
46  void do_tick(World& world, EconomyState& economy_state);
47 }
48 
Definition: world.hpp:114
void do_tick(World &world, EconomyState &economy_state)
Definition: economy.cpp:290
std::vector< Market > commodity_market
Definition: economy.hpp:44
std::vector< float > price
Definition: economy.hpp:36
std::vector< float > global_demand
Definition: economy.hpp:39
std::vector< float > supply
Definition: economy.hpp:37
CommodityId commodity
Definition: economy.hpp:35
std::vector< float > demand
Definition: economy.hpp:38