Exemplo n.º 1
0
        public GameObject FindByID(int id)
        {
            ManLink ptr = this.active;

            ManLink outNode = null;

            while (ptr != null)
            {
                if ((ptr as GameObjNode).gameObj.GameID.Equals(id))
                {
                    outNode = ptr;
                    break;
                }
                //{
                //    outNode = ptr;
                //    break;
                //}
                ptr = ptr.next;
            }
            GameObjNode tmpNode = outNode as GameObjNode;

            if (tmpNode != null)
            {
                return(tmpNode.gameObj);
            }
            else
            {
                return(null);
            }
            //return (outNode as GameObjNode).gameObj;
            // return (CollisionManager.GameObject)outNode;
        }
Exemplo n.º 2
0
        public void process()
        {
            ManLink ptr = this.active;

            while (ptr != null)
            {
                ((SBNode)ptr).Draw();

                ptr = ptr.next;
            }
        }
        public void UpdatePlayerObject(GameObject _obj)
        {
            ManLink ptr = this.active;

            //ManLink outNode = null;

            while (ptr != null)
            {
                if ((ptr as GameObjNode).gameObj.Equals(_obj))
                {
                    //ptr  = _obj;
                    //Console.WriteLine(" Player type :"+_obj.type+" \nRotation "+_obj.rotation+" Location "+_obj.location+" Speed "+_obj.objSpeed);
                    break;
                }
                ptr = ptr.next;
            }
        }
Exemplo n.º 4
0
        public void Update(World w)
        {
            ManLink ptr = this.active;

            GameObjNode gameObjNode = null;

            while (ptr != null)
            {
                gameObjNode = (GameObjNode)ptr;

                gameObjNode.gameObj.Update();

                ptr = ptr.next;
            }


            destroyBodies(w);
        }
Exemplo n.º 5
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);
        }
        public static GameObject FindByID(int p)
        {
            ManLink ptr = instance.active;

            ManLink    outNode = null;
            GameObject g       = null;

            while (ptr != null)
            {
                if ((ptr as GameObjNode).gameObj.gameId == p)
                {
                    outNode = ptr;
                    g       = (outNode as GameObjNode).gameObj;
                    break;
                }
                ptr = ptr.next;
            }
            return(g);
        }