Skip to content

Commit

Permalink
Juggler: Replace Vector with Array
Browse files Browse the repository at this point in the history
Because it's cool. 😎🆒
  • Loading branch information
dimensionscape committed Jul 10, 2024
1 parent 0ac3ba1 commit a36139b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/starling/animation/Juggler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package starling.animation;
import haxe.Constraints.Function;

import openfl.errors.ArgumentError;
import openfl.Vector;

import starling.events.Event;
import starling.events.EventDispatcher;
Expand Down Expand Up @@ -50,7 +49,7 @@ import starling.events.EventDispatcher;
*/
class Juggler implements IAnimatable
{
@:noCompletion private var __objects:Vector<IAnimatable>;
@:noCompletion private var __objects:Array<IAnimatable>;
@:noCompletion private var __objectIDs:Map<IAnimatable, UInt>;
@:noCompletion private var __elapsedTime:Float;
@:noCompletion private var __timeScale:Float;
Expand All @@ -75,7 +74,7 @@ class Juggler implements IAnimatable
{
__elapsedTime = 0;
__timeScale = 1.0;
__objects = new Vector<IAnimatable>();
__objects = new Array<IAnimatable>();
__objectIDs = new Map();
}

Expand Down Expand Up @@ -243,9 +242,9 @@ class Juggler implements IAnimatable
/** Removes all objects at once. */
public function purge():Void
{
// the object vector is not purged right away, because if this method is called
// the object Array is not purged right away, because if this method is called
// from an 'advanceTime' call, this would make the loop crash. Instead, the
// vector is filled with 'null' values. They will be cleaned up on the next call
// Array is filled with 'null' values. They will be cleaned up on the next call
// to 'advanceTime'.

var object:IAnimatable, dispatcher:EventDispatcher;
Expand Down Expand Up @@ -434,7 +433,7 @@ class Juggler implements IAnimatable
private function get_timeScale():Float { return __timeScale; }
private function set_timeScale(value:Float):Float { return __timeScale = value; }

/** The actual vector that contains all objects that are currently being animated. */
private var objects(get, never):Vector<IAnimatable>;
private function get_objects():Vector<IAnimatable> { return __objects; }
/** The actual Array that contains all objects that are currently being animated. */
private var objects(get, never):Array<IAnimatable>;
private function get_objects():Array<IAnimatable> { return __objects; }
}

0 comments on commit a36139b

Please sign in to comment.