Emergency 20 Dokumentation  4.2.0
ModificationWindowDataSource.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include <Rocket/Controls/DataSource.h>
14 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class Mod;
22 }
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
39  class ModificationWindowDataSource : public Rocket::Controls::DataSource
40  {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
47  struct TableData
48  {
55  };
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public methods ]
60  //[-------------------------------------------------------]
61  public:
64 
65  void insertNewRow(const Rocket::Core::String& table, TableData* data);
66  void restoreTable(const Rocket::Core::String& table);
67  void changeIsActivated(uint32 modID, const Rocket::Core::String& table);
68 
69  void pushModUp(const Rocket::Core::String& modName);
70  void pushModDown(const Rocket::Core::String& modName);
71 
72  void recollectTableData();
73  void saveOrder();
74 
75  void updateAfterModsAdded();
76  void updateAfterModRemoved(const std::string& modName);
77 
78  TableData* getFirstTableData() { return mTableDataModifications[0]; };
79 
80 
81  //[-------------------------------------------------------]
82  //[ Public virtual Rocket::Controls::DataSource methods ]
83  //[-------------------------------------------------------]
84  public:
85  virtual void GetRow(Rocket::Core::StringList& row, const Rocket::Core::String& table, int rowIndex, const Rocket::Core::StringList& columns) override;
86  virtual int GetNumRows(const Rocket::Core::String& table) override;
87 
88 
89  //[-------------------------------------------------------]
90  //[ Private methods ]
91  //[-------------------------------------------------------]
92  private:
93  TableData* createTableDataForMod(const Mod& mod);
94  void deleteModificationTableData();
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private data ]
99  //[-------------------------------------------------------]
100  private:
101  std::vector<TableData*> mTableDataModifications;
102 
103 
104  };
105 
106 
107 //[-------------------------------------------------------]
108 //[ Namespace ]
109 //[-------------------------------------------------------]
110 } // em5
Definition: ActionPriority.h:13
void changeIsActivated(uint32 modID, const Rocket::Core::String &table)
void pushModUp(const Rocket::Core::String &modName)
Rocket::Core::String image
Definition: ModificationWindowDataSource.h:53
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 mod class.
Definition: Mod.h:47
virtual void GetRow(Rocket::Core::StringList &row, const Rocket::Core::String &table, int rowIndex, const Rocket::Core::StringList &columns) override
Rocket::Core::String modification
Definition: ModificationWindowDataSource.h:51
Definition: ModificationWindowDataSource.h:47
void insertNewRow(const Rocket::Core::String &table, TableData *data)
Rocket::Core::String modName
Definition: ModificationWindowDataSource.h:49
Rocket::Core::String activated
Definition: ModificationWindowDataSource.h:50
Rocket::Core::String description
Definition: ModificationWindowDataSource.h:52
void updateAfterModRemoved(const std::string &modName)
virtual int GetNumRows(const Rocket::Core::String &table) override
void restoreTable(const Rocket::Core::String &table)
Definition: MiniMapWindow.h:43
uint32 modOrderIndex
Definition: ModificationWindowDataSource.h:54
void pushModDown(const Rocket::Core::String &modName)
TableData * getFirstTableData()
Definition: ModificationWindowDataSource.h:78
ModificationWindowDataSource.
Definition: ModificationWindowDataSource.h:39