Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

used cleaner overwrite getOrderedComponents() reflection method inste…

…ad for lesser chance of typos.
  • Loading branch information...
commit 2124bafe6d933637d179a896f4ac2fda1a20ef41 1 parent b649d9a
@Glidias authored
View
6 hx/hashds/game/alchemy/A_Node.hx
@@ -2,6 +2,7 @@ package hashds.game.alchemy;
import de.polygonal.ds.IntIntHashTable;
import de.polygonal.ds.mem.IntMemory;
import de.polygonal.ds.mem.MemoryAccess;
+import flash.errors.Error;
import flash.Memory;
/**
@@ -35,6 +36,11 @@ class A_Node extends A_Base
@field public inline function getEntityHeader(addr:Int):Int {
return _getEntityHeader(addr);
}
+
+ public function getOrderedComponents():Array<Dynamic> {
+ throw new Error("Please overwrite!");
+ return null;
+ }
/**
View
7 hx/hashds/game/alchemy/nodes/A_MovementNode.hx
@@ -16,9 +16,10 @@ class A_MovementNode extends A_Node
@component('velocity') public var velocity:A_Tuple2;
@component('rotation') public var rotation:A_Tuple2;
- @componentOrder('position', 'velocity', 'rotation')
- public function myComponents(position:A_Tuple2, velocity:A_Tuple2, rotation:A_Tuple2):Void { }
-
+ override public function getOrderedComponents():Array<Dynamic> {
+ return [position, velocity, rotation];
+ }
+
public function new()
{
super();

0 comments on commit 2124baf

Please sign in to comment.
Something went wrong with that request. Please try again.