Pop-Engine/Pop Engine/Population.h

48 lines
1.0 KiB
C
Raw Normal View History

2019-08-12 16:25:03 +00:00
#pragma once
#include <memory>
2019-08-22 15:56:53 +00:00
#include <cstdint>
2019-08-12 16:25:03 +00:00
#include "Career.h"
#include "Market.h"
2019-08-22 15:56:53 +00:00
#include "Land.h"
2019-08-12 16:25:03 +00:00
using namespace std;
2019-08-22 15:56:53 +00:00
// The number to identify certain population.
typedef uint32_t PopID;
2019-08-12 16:25:03 +00:00
class Population
{
public:
2019-08-12 16:52:11 +00:00
// Population group working to get production.
2019-08-12 16:25:03 +00:00
void work(void);
2019-08-12 16:52:11 +00:00
// Sell production to get money.
2019-08-22 15:56:53 +00:00
void sell_production(void);
2019-08-12 16:52:11 +00:00
// Give part of the money to nation.
2019-08-22 15:56:53 +00:00
void give_tax(void);
2019-08-12 16:52:11 +00:00
// Buy the production the population needed from the market.
2019-08-22 15:56:53 +00:00
void buy_needing(void);
2019-08-12 16:52:11 +00:00
// Part of the population move to another land
2019-08-22 15:56:53 +00:00
void move_away(void);
2019-08-12 16:52:11 +00:00
//Part of the population changes the career
2019-08-12 16:25:03 +00:00
void increase(void);
private:
2019-08-12 16:52:11 +00:00
// Career of this population group.
2019-08-12 16:25:03 +00:00
shared_ptr<Career> career;
2019-08-22 15:56:53 +00:00
// The land which the population belongs to.
shared_ptr<Land> land;
// Ability to make production.
float ability;
2019-08-12 16:52:11 +00:00
// The number of people of this population group.
2019-08-12 16:25:03 +00:00
float pop;
2019-08-12 16:52:11 +00:00
// Money rest from all recycle.
2019-08-12 16:25:03 +00:00
float money;
2019-08-22 15:56:53 +00:00
// Goods which this population makes.
float goods;
PopID pop_id;
2019-08-12 16:25:03 +00:00
2019-08-22 15:56:53 +00:00
};