public static void Update(ref physics_buffer_message p)
        {
            ManLink ptr = instance.active;


            PhysicsObj physNode = null;
            Body       body     = null;
            int        i        = 0;

            while (ptr != null)
            {
                physNode = (PhysicsObj)ptr;
                body     = physNode.body;

                if (p.buff[i].id == physNode.gameObj.gameId)
                {
                    physNode.body.Position = p.buff[i].position;
                    physNode.body.Rotation = p.buff[i].rotation;
                    physNode.gameObj.pushPhysics(body.GetAngle(), body.Position);
                }

                i++;
                ptr = ptr.next;
            }
        }
Example #2
0
 // public methods: -----------------------------------------------------------------------
 protected CopyOfMan()
 {
     this.active = null;
     this.reserve = null;
     this.initalized = false;
     this.totalNum = 0;
     this.reserveGrow = 0;
 }
        private ManLink privReserveGetNodeFromFront(ref ManLink head)
        {
            Debug.Assert(head != null);

            ManLink node = head;

            head = node.next;
            if (node.next != null)
            {
                node.next.prev = node.prev;
            }
            return(node);
        }
Example #4
0
        protected void privActiveRemoveNode(ManLink node, ref ManLink head)
        {
            if (node.prev != null)
            {	// middle or last node
                node.prev.next = node.next;
            }
            else
            {  // first
                head = node.next;
            }

            if (node.next != null)
            {	// middle node
                node.next.prev = node.prev;
            }
        }
        public void Update()
        {
            ManLink    ptr      = this.active;
            PhysicsObj physNode = null;
            Body       body     = null;


            while (ptr != null)
            {
                physNode = (PhysicsObj)ptr;
                body     = physNode.body;
                physNode.gameObj.pushPhysics(body.GetAngle(), body.Position);

                ptr = ptr.next;
            }
        }
        protected void privActiveRemoveNode(ManLink node, ref ManLink head)
        {
            if (node.prev != null)
            {   // middle or last node
                node.prev.next = node.next;
            }
            else
            {  // first
                head = node.next;
            }

            if (node.next != null)
            {   // middle node
                node.next.prev = node.prev;
            }
        }
Example #7
0
        protected void privActiveAddToFront(ManLink node, ref ManLink head)
        {
            Debug.Assert(node != null);

            if (head == null)
            {
                head = node;
                node.next = null;
                node.prev = null;
            }
            else
            {
                node.next = head;
                head.prev = node;
                head = node;
            }
        }
        // private methods ------------------------------------------------------------------------------

        protected object privFind(Enum _enumName)
        {
            // // Do we need to get more Images?
            ManLink pLink = this.active;

            while (pLink != null)
            {
                if (pLink.getName().Equals(_enumName))
                {
                    break;
                }
                pLink = pLink.next;
            }

            //return pImage;
            return(pLink);
        }
        protected void privActiveAddToFront(ManLink node, ref ManLink head)
        {
            Debug.Assert(node != null);

            if (head == null)
            {
                head      = node;
                node.next = null;
                node.prev = null;
            }
            else
            {
                node.next = head;
                head.prev = node;
                head      = node;
            }
        }
        public static void pushToBuffer(ref physics_buffer[] p)
        {
            PhysicsMan pMan = PhysicsMan.instance;

            ManLink    ptr     = pMan.active;
            PhysicsObj phyNode = null;
            Body       body    = null;

            int i = 0;

            while (ptr != null)
            {
                phyNode = (PhysicsObj)ptr;
                body    = phyNode.body;

                p[i].id       = phyNode.gameObj.gameId;
                p[i].position = body.Position;
                p[i].rotation = body.GetAngle();

                i++;
                ptr = ptr.next;
            }
        }
Example #11
0
        public static void PushToBuffer(ref PhysicsBuffer[] physicsBuff)
        {
            PhysicsMan pMan = PhysicsMan.Instance();

            ManLink    ptr      = pMan.active;
            PhysicsObj physNode = null;
            Body       body     = null;

            int i = 0;

            while (ptr != null)
            {
                physNode = (PhysicsObj)ptr;
                body     = physNode.body;

                //Push to buffer
                physicsBuff[i].id       = physNode.gameObj.GameID;
                physicsBuff[i].position = body.Position;
                physicsBuff[i].rotation = body.GetAngle();

                i++;
                ptr = ptr.next;
            }
        }
Example #12
0
        private ManLink privReserveGetNodeFromFront(ref ManLink head)
        {
            Debug.Assert(head != null);

            ManLink node = head;
            head = node.next;
            if (node.next != null)
            {
                node.next.prev = node.prev;
            }
            return node;
        }
Example #13
0
 // public methods: -----------------------------------------------------------------------
 protected Manager()
 {
     this.active = null;
     this.reserve = null;
     this.initalized = false;
     this.totalNum = 0;
     this.reserveGrow = 0;
 }
Example #14
0
 protected virtual void Initialize()
 {
     this.next = null;
     this.prev = null;
 }
 protected virtual void Initialize()
 {
     this.next = null;
     this.prev = null;
 }