00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OPENCITY_ELECTRICITYSIM_H_
00021 #define _OPENCITY_ELECTRICITYSIM_H_ 1
00022
00023 #include "main.h"
00024 #include "simulator.h"
00025
00026 #include <deque>
00027 #include <vector>
00028
00029 using namespace std;
00030
00034 class ElectricitySim : public Simulator {
00035 public:
00036 ElectricitySim(
00037 SDL_mutex* mutex,
00038 BuildingLayer* pblayer,
00039 Map* pmap );
00040 ~ElectricitySim();
00041
00042
00043
00047 void
00048 SaveTo( std::fstream& rfs );
00049
00050
00051
00055 void
00056 LoadFrom( std::fstream& rfs );
00057
00058
00059 int
00060 Main();
00061
00062 void
00063 AddStructure(
00064 const uint & w1,
00065 const uint & h1,
00066 const uint & w2,
00067 const uint & h2 );
00068
00069 void
00070 RemoveStructure(
00071 const uint & w1,
00072 const uint & h1,
00073 const uint & w2,
00074 const uint & h2 );
00075
00076
00077 private:
00078 uint _uiNumberEPlant;
00079 int _iValueMax;
00080 deque<pair<uint, uint> > dequepairui;
00081 vector<pair<uint, uint> > vectorpairuiEPlant;
00082
00083
00084 bool
00085 dequeContain( const pair<uint, uint> &);
00086
00087 };
00088
00089 #endif
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122