1 ////////////////////////////////////////////////////////////////////////////////
2 // Scorched3D (c) 2000-2009
4 // This file is part of Scorched3D.
6 // Scorched3D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // Scorched3D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with Scorched3D; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ////////////////////////////////////////////////////////////////////////////////
21 #if !defined(AFX_ACTION_H__2C00E711_B337_4665_AB54_C6661FD67E5D__INCLUDED_)
22 #define AFX_ACTION_H__2C00E711_B337_4665_AB54_C6661FD67E5D__INCLUDED_
24 #include <common/fixed.h>
28 class ScorchedContext
;
35 virtual ~ActionRenderer();
37 virtual void draw(Action
*action
) = 0;
38 virtual void simulate(Action
*action
, float frametime
, bool &removeAction
);
45 Action(const char *name
, ActionRenderer
*render
= 0);
48 virtual void init() = 0;
51 virtual void simulate(fixed frameTime
, bool &removeAction
);
53 virtual void setActionRender(ActionRenderer
*renderer
);
54 virtual void setScorchedContext(ScorchedContext
*context
);
55 virtual ScorchedContext
*getScorchedContext();
56 virtual bool getReferenced() { return false; }
57 virtual std::string
getActionType() { return name_
; }
58 virtual std::string
getActionDetails() { return ""; }
60 void setActionStartTime(fixed time
) { actionStartTime_
= time
; }
61 fixed
getActionStartTime() { return actionStartTime_
; }
62 bool getActionEvent() { return actionEvent_
; }
63 void setActionEvent(bool ae
) { actionEvent_
= ae
; }
64 unsigned int getActionNumber() { return actionNumber_
; }
65 void setActionNumber(unsigned int number
) { actionNumber_
= number
; }
69 ActionRenderer
*renderer_
;
70 ScorchedContext
*context_
;
71 fixed actionStartTime_
;
72 unsigned int actionNumber_
;
77 class SpriteAction
: public Action
80 SpriteAction(ActionRenderer
*render
= 0);
81 virtual ~SpriteAction();
87 #endif // !defined(AFX_ACTION_H__2C00E711_B337_4665_AB54_C6661FD67E5D__INCLUDED_)