Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
typescript: Rename Sup.walkActorTree to Sup.traverseActors
Browse files Browse the repository at this point in the history
  • Loading branch information
bilou84 committed Oct 15, 2016
1 parent 25d158f commit 6f532d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions plugins/default/typescript/typescriptAPI/Sup.Actor.d.ts.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
declare namespace Sup {
function getActor(name: string): Actor;
function getRootActors(): Actor[];
// This is relatively expensive. If it's possible, use walkActorTree() instead.

// This is relatively expensive. If it's possible, use traverseActors() instead.
function getAllActors(): Actor[];

function destroyAllActors(): void;

// The callback should return whether to keep traversing.
// Return false to stop the loop to have better performance.
function walkActorTree(callback: (actor: Actor) => boolean): void;
function walkActorTree(startActor: Actor, callback: (actor: Actor) => boolean): void;
function traverseActors(callback: (actor: Actor) => boolean): void;
function traverseActors(startActor: Actor, callback: (actor: Actor) => boolean): void;

class Actor {
// INSERT_COMPONENT_ACCESSORS
Expand Down
2 changes: 1 addition & 1 deletion plugins/default/typescript/typescriptAPI/Sup.Actor.ts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Sup {
player.gameInstance.tree.walkTopDown((actor) => { actor.__outer.__inner = null; actor.__outer = null; return true; });
}

export function walkActorTree(startActor, callback) {
export function traverseActors(startActor, callback) {
if (callback == null) {
callback = startActor;
player.gameInstance.tree.walkTopDown((actor) => {
Expand Down

0 comments on commit 6f532d9

Please sign in to comment.