/** * Class Node * * A member of the the Cluster Engine */ package cluster { import flash.display.Sprite; public class Node extends Sprite { protected var _siblings:Array = new Array(); public function Node() { // } /** * Return a clone of the array of siblings */ public function get siblings():Array { var arr:Array = new Array(); while (arr.length < _siblings.length) { arr[arr.length] = _siblings[arr.length]; } return arr; } /** * Add a sibling to the list of the siblings, if it already * a member of the siblingList it isn't added. */ public function addSibling( node:Node ):void { if (_siblings.indexOf( node ) >= 0) return; _siblings.push( node ); } /** * Remove a sibling from the list of siblings, if it isn't * a member nothing is done. */ public function removeSibling( node:Node ):void { if (_siblings.indexOf( node ) >= 0) _siblings.splice( _siblings.indexOf( node ), 1 ); } } }