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;
37 // What kingdom this action is used for
39 // lastID is used for some provisional error checking
43 Action (ID kingdomID
);
46 operator() (std::string rtext
) =0;
49 //typedef std::map <std::string, Action*> ActionList;
50 class ActionList
: public std::map
<std::string
, Action
*>
54 virtual ~ActionList ();
57 listItem (const char*);
61 class IDAction
: public def::Action
64 IDAction (ID kingdomID
);
67 operator() (std::string rtext
);
72 class NameAction
: public Action
75 NameAction (ID kingdomID
);
78 operator() (std::string rtext
);
83 class ModelAction
: public Action
86 ModelAction (ID kingdomID
);
89 operator() (std::string rtext
);
94 class IconAction
: public Action
97 IconAction (ID kingdomID
);
100 operator() (std::string rtext
);
105 class XAction
: public Action
108 XAction (ID kingdomID
);
111 operator() (std::string rtext
);
115 class YAction
: public Action
118 YAction (ID kingdomID
);
121 operator() (std::string rtext
);
125 class ZAction
: public Action
128 ZAction (ID kingdomID
);
131 operator() (std::string rtext
);
135 class ScaleAction
: public Action
138 ScaleAction (ID kingdomID
);
141 operator() (std::string rtext
);
145 class RAction
: public Action
148 RAction (ID kingdomID
);
151 operator() (std::string rtext
);
155 class GAction
: public Action
158 GAction (ID kingdomID
);
161 operator() (std::string rtext
);
165 class BAction
: public Action
168 BAction (ID kingdomID
);
171 operator() (std::string rtext
);
175 class ColorAction
: public Action
178 ColorAction (ID kingdomID
);
181 operator() (std::string rtext
);
184 class AutofadeAction
: public Action
187 AutofadeAction (ID kingdomID
);
190 operator() (std::string rtext
);
193 class AlphaAction
: public Action
196 AlphaAction (ID kingdom
);
199 operator() (std::string rtext
);
202 class ShineAction
: public Action
205 ShineAction (ID kingdom
);
208 operator() (std::string rtext
);
216 //extern ActionList actionList;
217 class ActionList
: public def::ActionList
226 //extern ActionList actionList;
227 class ActionList
: public def::ActionList
236 //extern ActionList actionList;
237 class ActionList
: public def::ActionList
244 } /* namespace def */
247 #endif /* STRANDED_DEFACTION_HH */