2
* This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
3
* For full copyright and license information please refer to doc/license.txt.
9
* The base class for Objects to be used in a GameDriver.
11
* The Generic non-specified GameDriverType and the casts are required to
12
* resolve a type loop of the two classes trying to refer to each other. The
13
* overhead in this class was less, therefore it is done here.
15
class BaseGameObject<GameDriverType> implements GameObject
17
/*protected*/ var game : GameDriverType;
18
/*protected*/ var destroyed : Bool;
20
public function new( game : GameDriverType )
25
cast( game, BaseGameDriver<Dynamic> ).addGameObject( this );
28
/*virtual*/ function destroy()
30
ASSERT_FALSE( destroyed );
33
cast( game, BaseGameDriver<Dynamic> ).removeGameObject( this );
37
* Should be overridden by derived classes if they need to perform
40
/*virtual*/ public function stepTime( elapsed : Float ) : Void
42
//does nothing by default