-
Notifications
You must be signed in to change notification settings - Fork 2
AttachableList
Joel Martinez edited this page Jul 1, 2013
·
2 revisions
Provides a list that establishes a two way relationship between the list and the attached object. Both Sprite, and PositionedObject both implement the removeSelfFromListsBelongingTo()
method, which will remove the entity from any attachable list it has been added to.
var ball = engineInstance.SpriteManager.add("http://www.flatredball.com/frb/docs/images/9/99/Frblogo128.png");
var list = new frb.AttachableList();
list.add(ball);
console.log(list.contains(ball));// true
list.remove(ball);
console.log(list.contains(ball));// false
list.add(ball);
ball.removeSelfFromListsBelongingTo();
console.log(list.contains(ball));// false