Exemplo n.º 1
0
        public void addPhysicsObj(GameObject _gameObj,Body _body)
        {
            PhysicsObj obj = new PhysicsObj(_gameObj, _body);
            _gameObj.physicsObj = obj;

            this.privActiveAddToFront((ManLink)obj, ref this.active);
        }
Exemplo n.º 2
0
        public void Set(GameObject _obj)
        {
            base.Initialize();

            this.gameObj = _obj;
            this.type = _obj.type;
        }
Exemplo n.º 3
0
 public GameObjNode()
 {
     this.Initialize();
     this.gameObj = null;
 }
Exemplo n.º 4
0
        private GameObjNode findGameObj(GameObject _obj)
        {
            ManLink ptr = this.active;

            ManLink outNode = null;

            while (ptr != null)
            {
                if ((ptr as GameObjNode).gameObj.Equals(_obj))
                {
                    outNode = ptr;
                    break;
                }
                ptr = ptr.next;
            }

            return (outNode as GameObjNode);
        }
Exemplo n.º 5
0
        public void remove(batchEnum _enum, GameObject _obj)
        {
            GameObjNode node = findGameObj(_obj);

            if (node != null)
            {
                if (node.prev != null)
                {	// middle or last node
                    node.prev.next = node.next;
                }
                else
                {  // first
                    this.active = node.next;
                }

                if (node.next != null)
                {	// middle node
                    node.next.prev = node.prev;
                }

                addBodyToDestroy(_obj.physicsObj.body);

                if (_obj.spriteRef != null)
                {
                    SBNode SBNode = SpriteBatchManager.Instance().getBatch(_enum);
                    SBNode.removeDisplayObject(_obj.spriteRef);
                }

                if (_obj.physicsObj != null)
                {
                    PhysicsMan.Instance().removePhysicsObj(_obj.physicsObj);
                }
            }
        }
Exemplo n.º 6
0
        // For Linked List
        public void addGameObj(GameObject _obj)
        {
            GameObjNode node = new GameObjNode();
            _obj.setIndexNum(objNumberCounter++);
            node.Set(_obj);

            this.privActiveAddToFront((ManLink)node, ref this.active);
        }
Exemplo n.º 7
0
 public PhysicsObj(GameObject _obj, Body _body)
 {
     gameObj = _obj;
     body = _body;
 }
Exemplo n.º 8
0
 public override void Accept(GameObject other, Vector2 _point)
 {
     other.VisitBomb(this, _point);
 }
Exemplo n.º 9
0
 public virtual void Accept(GameObject _obj, Vector2 _point)
 {
 }