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
{
35
CommodityId
commodity
;
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 {
43
Trade
trade
;
44
std::vector<Market>
commodity_market
;
45
};
46
void
do_tick
(
World
& world,
EconomyState
& economy_state);
47
}
48
World
Definition:
world.hpp:114
Economy
Definition:
economy.hpp:33
Economy::do_tick
void do_tick(World &world, EconomyState &economy_state)
Definition:
economy.cpp:290
CommodityId
Definition:
objects.hpp:31
Economy::EconomyState
Definition:
economy.hpp:42
Economy::EconomyState::commodity_market
std::vector< Market > commodity_market
Definition:
economy.hpp:44
Economy::EconomyState::trade
Trade trade
Definition:
economy.hpp:43
Economy::Market
Definition:
economy.hpp:34
Economy::Market::price
std::vector< float > price
Definition:
economy.hpp:36
Economy::Market::global_demand
std::vector< float > global_demand
Definition:
economy.hpp:39
Economy::Market::supply
std::vector< float > supply
Definition:
economy.hpp:37
Economy::Market::commodity
CommodityId commodity
Definition:
economy.hpp:35
Economy::Market::demand
std::vector< float > demand
Definition:
economy.hpp:38
Economy::Trade
Definition:
trade.hpp:34
trade.hpp
game
src
server
economy.hpp
Generated by
1.9.1