Eliminated some problems resulting from last merge
[openstranded.git] / src / defparse / defaction.hh
blob9671cf778f324fcc082b73ab53d7293e1cc396bd
1 /*
2 * This header includes more specific functions for definition actions.
3 * Actions are functors that are executed by the definition parser
4 * upon recognizing valid entries.
6 * Copyright (C) 2008 Hermann Walth
8 * This file is part of OpenStranded
10 * OpenStranded is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * OpenStranded is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef STRANDED_DEFACTION_HH
25 #define STRANDED_DEFACTION_HH
27 #include "defparse.hh"
29 typedef unsigned int ID;
30 typedef unsigned char uint8_t;
32 namespace def {
34 class Action
36 protected:
37 // What kingdom this action is used for
38 ID kingdomID;
39 // lastID is used for some provisional error checking
40 ID lastType;
42 public:
43 Action (ID kingdomID);
45 virtual void
46 operator() (std::string rtext) =0;
49 //typedef std::map <std::string, Action*> ActionList;
50 class ActionList: public std::map <std::string, Action*>
52 public:
53 ActionList ();
54 virtual ~ActionList ();
56 Action*&
57 listItem (const char*);
61 class IDAction: public def::Action
63 public:
64 IDAction (ID kingdomID);
66 void
67 operator() (std::string rtext);
72 class NameAction: public Action
74 public:
75 NameAction (ID kingdomID);
77 void
78 operator() (std::string rtext);
83 class ModelAction: public Action
85 public:
86 ModelAction (ID kingdomID);
88 void
89 operator() (std::string rtext);
94 class IconAction: public Action
96 public:
97 IconAction (ID kingdomID);
99 void
100 operator() (std::string rtext);
105 class XAction: public Action
107 public:
108 XAction (ID kingdomID);
110 void
111 operator() (std::string rtext);
115 class YAction: public Action
117 public:
118 YAction (ID kingdomID);
120 void
121 operator() (std::string rtext);
125 class ZAction: public Action
127 public:
128 ZAction (ID kingdomID);
130 void
131 operator() (std::string rtext);
135 class ScaleAction: public Action
137 public:
138 ScaleAction (ID kingdomID);
140 void
141 operator() (std::string rtext);
145 class RAction: public Action
147 public:
148 RAction (ID kingdomID);
150 void
151 operator() (std::string rtext);
155 class GAction: public Action
157 public:
158 GAction (ID kingdomID);
160 void
161 operator() (std::string rtext);
165 class BAction: public Action
167 public:
168 BAction (ID kingdomID);
170 void
171 operator() (std::string rtext);
175 class ColorAction: public Action
177 public:
178 ColorAction (ID kingdomID);
180 void
181 operator() (std::string rtext);
184 class AutofadeAction: public Action
186 public:
187 AutofadeAction (ID kingdomID);
189 void
190 operator() (std::string rtext);
193 class AlphaAction: public Action
195 public:
196 AlphaAction (ID kingdom);
198 void
199 operator() (std::string rtext);
202 class ShineAction: public Action
204 public:
205 ShineAction (ID kingdom);
207 void
208 operator() (std::string rtext);
214 namespace object
216 //extern ActionList actionList;
217 class ActionList: public def::ActionList
219 public:
220 ActionList ();
224 namespace unit
226 //extern ActionList actionList;
227 class ActionList: public def::ActionList
229 public:
230 ActionList ();
234 namespace item
236 //extern ActionList actionList;
237 class ActionList: public def::ActionList
239 public:
240 ActionList ();
244 } /* namespace def */
247 #endif /* STRANDED_DEFACTION_HH */