From e3b0a9e15855091d15b6f01eeca19eb292a9068d Mon Sep 17 00:00:00 2001 From: saturneric Date: Tue, 13 Aug 2019 00:52:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pop Engine/Career.h | 2 ++ Pop Engine/Engine.h | 6 +++++- Pop Engine/Land.cpp | 1 + Pop Engine/Land.h | 23 +++++++++++++++++++++++ Pop Engine/Market.h | 4 +++- Pop Engine/Need.h | 9 ++++++--- Pop Engine/Pop Engine.vcxproj | 2 ++ Pop Engine/Pop Engine.vcxproj.filters | 6 ++++++ Pop Engine/Population.h | 11 +++++++++-- Pop Engine/Production.h | 3 +++ 10 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 Pop Engine/Land.cpp create mode 100644 Pop Engine/Land.h diff --git a/Pop Engine/Career.h b/Pop Engine/Career.h index c045f96..ce2fe44 100644 --- a/Pop Engine/Career.h +++ b/Pop Engine/Career.h @@ -12,7 +12,9 @@ class Career public: private: + // The prodution which this career makes. shared_ptr pdt; + // Produtions which this career needed. shared_ptr ned; }; diff --git a/Pop Engine/Engine.h b/Pop Engine/Engine.h index 997c169..11db334 100644 --- a/Pop Engine/Engine.h +++ b/Pop Engine/Engine.h @@ -4,14 +4,18 @@ #include #include "Market.h" +#include "Land.h" using namespace std; class Engine { public: - + private: + // Manage all the markets. vector> mkts; + // Manage all the lands in the world. + vector> lands; }; diff --git a/Pop Engine/Land.cpp b/Pop Engine/Land.cpp new file mode 100644 index 0000000..a6fc3f7 --- /dev/null +++ b/Pop Engine/Land.cpp @@ -0,0 +1 @@ +#include "Land.h" diff --git a/Pop Engine/Land.h b/Pop Engine/Land.h new file mode 100644 index 0000000..c8e4db8 --- /dev/null +++ b/Pop Engine/Land.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include + +#include "Population.h" +#include "Production.h" + +using namespace std; + +class Land +{ +public: + +private: + vector> pops; + shared_ptr mkt; + vector> pdts; + float max_pop; + string name; +}; + diff --git a/Pop Engine/Market.h b/Pop Engine/Market.h index 67dd0ae..1238433 100644 --- a/Pop Engine/Market.h +++ b/Pop Engine/Market.h @@ -13,9 +13,11 @@ class Market public: private: + // Selling productions in the market. vector> sl_pdts; - vector> pops; + // Children markets. vector> sub_mkts; + // Parent market. shared_ptr pae_mkts; }; diff --git a/Pop Engine/Need.h b/Pop Engine/Need.h index f8b2b66..04bc91a 100644 --- a/Pop Engine/Need.h +++ b/Pop Engine/Need.h @@ -12,8 +12,11 @@ class Need public: private: - vector> base_pdts; - vector> improve_pdts; - vector> high_pdts; + // Certain kinds of production which one of those careers need to matain their lives. + vector, float>> base_pdts; + // Certain kinds of production to improve their lives. + vector, float>> improve_pdts; + // Certain kinds of production to satisfy their lives. + vector, float>> high_pdts; }; diff --git a/Pop Engine/Pop Engine.vcxproj b/Pop Engine/Pop Engine.vcxproj index 52a3290..0c30c50 100644 --- a/Pop Engine/Pop Engine.vcxproj +++ b/Pop Engine/Pop Engine.vcxproj @@ -153,6 +153,7 @@ + @@ -163,6 +164,7 @@ + diff --git a/Pop Engine/Pop Engine.vcxproj.filters b/Pop Engine/Pop Engine.vcxproj.filters index a2c5fa2..955e4f7 100644 --- a/Pop Engine/Pop Engine.vcxproj.filters +++ b/Pop Engine/Pop Engine.vcxproj.filters @@ -39,6 +39,9 @@ 源文件 + + 源文件 + @@ -62,5 +65,8 @@ 头文件 + + 头文件 + \ No newline at end of file diff --git a/Pop Engine/Population.h b/Pop Engine/Population.h index 90a04d1..2630ee6 100644 --- a/Pop Engine/Population.h +++ b/Pop Engine/Population.h @@ -10,18 +10,25 @@ using namespace std; class Population { public: + // Population group working to get production. void work(void); + // Sell production to get money. void sell(void); + // Give part of the money to nation. void tax(void); + // Buy the production the population needed from the market. void buy(void); + // Part of the population move to another land void move(void); + //Part of the population changes the career void increase(void); - private: + // Career of this population group. shared_ptr career; - shared_ptr market; + // The number of people of this population group. float pop; + // Money rest from all recycle. float money; }; \ No newline at end of file diff --git a/Pop Engine/Production.h b/Pop Engine/Production.h index bc12a30..da3e766 100644 --- a/Pop Engine/Production.h +++ b/Pop Engine/Production.h @@ -11,8 +11,11 @@ class Production public: private: + // Raw material to make this production. vector> material; + // Base value of this prodution. float value; + // Name of this production. string name; };