Esempio n. 1
0
        public void DumpBoxSprite()
        {
            Debug.WriteLine("Name: {0} ({1})", this.name, this.GetHashCode());
            Debug.WriteLine("X: {0}, Y:{1}, SX:{2}, SY:{3}", this.x, this.y, this.sx, this.sy);
            Debug.WriteLine("Red: {0}, Green: {1}, Blue:{2}", this.poLineColor.red, this.poLineColor.green, this.poLineColor.blue);

            if (this.pPrev == null)
            {
                Debug.WriteLine("previous: null");
            }
            else
            {
                BoxSprite pTemp = (BoxSprite)this.pPrev;
                Debug.WriteLine("previous: {0}, {1}", pTemp.name, pTemp.GetHashCode());
            }

            if (this.pNext == null)
            {
                Debug.WriteLine("next: null");
            }
            else
            {
                BoxSprite pTemp = (BoxSprite)this.pNext;
                Debug.WriteLine("next: {0}, {1}", pTemp.name, pTemp.GetHashCode());
            }
        }
Esempio n. 2
0
        protected override void derivedReset(DLink pLink)
        {
            Debug.Assert(pLink != null);
            BoxSprite pBoxSprite = (BoxSprite)pLink;

            pBoxSprite.deepClear();
        }
        public void Dump()
        {
            Debug.WriteLine("   Name: {0} ({1})", this.name, this.GetHashCode());
            Debug.WriteLine("      Color(r,b,g): {0},{1},{2} ({3})", this.poLineColor.red, this.poLineColor.green, this.poLineColor.blue, this.poLineColor.GetHashCode());
            Debug.WriteLine("        AzulSprite: ({0})", this.poAzulBoxSprite.GetHashCode());
            Debug.WriteLine("             (x,y): {0},{1}", this.x, this.y);
            Debug.WriteLine("           (sx,sy): {0},{1}", this.sx, this.sy);
            Debug.WriteLine("           (angle): {0}", this.angle);

            if (this.pNext == null)
            {
                Debug.WriteLine("              next: null");
            }
            else
            {
                BoxSprite pTmp = (BoxSprite)this.pNext;
                Debug.WriteLine("              next: {0} ({1})", pTmp.name, pTmp.GetHashCode());
            }

            if (this.pPrev == null)
            {
                Debug.WriteLine("              prev: null");
            }
            else
            {
                BoxSprite pTmp = (BoxSprite)this.pPrev;
                Debug.WriteLine("              prev: {0} ({1})", pTmp.name, pTmp.GetHashCode());
            }
        }
Esempio n. 4
0
        public void Dump()
        {
            // Dump - Print contents to the debug output window
            //        Using HASH code as its unique identifier
            Debug.WriteLine("   Name: ({0})", this.GetHashCode());
            Debug.WriteLine("      Color(r,b,g): {0},{1},{2} ({3})", this.pColor.red, this.pColor.green, this.pColor.blue, this.pColor.GetHashCode());
            Debug.WriteLine("        AzulSprite: ({0})", this.pBox.GetHashCode());
            Debug.WriteLine("             (x,y): {0},{1}", this.x, this.y);
            Debug.WriteLine("           (sx,sy): {0},{1}", this.sx, this.sy);
            Debug.WriteLine("           (angle): {0}", this.angle);

            if (this.pNext == null)
            {
                Debug.WriteLine("              next: null");
            }
            else
            {
                BoxSprite pTmp = (BoxSprite)this.pNext;
                Debug.WriteLine("              next:  ({0})", pTmp.GetHashCode());
            }

            if (this.pPrev == null)
            {
                Debug.WriteLine("              prev: null");
            }
            else
            {
                BoxSprite pTmp = (BoxSprite)this.pPrev;
                Debug.WriteLine("              prev: {0} ", pTmp.GetHashCode());
            }
        }
Esempio n. 5
0
        public ColObject(ProxySprite pProxySprite)
        {
            Debug.Assert(pProxySprite != null);

            // Create Collision Rect
            // Use the reference sprite to set size and shape
            // need to refactor if you want it different
            GameSprite pSprite = pProxySprite.pSprite;

            Debug.Assert(pSprite != null);

            // Origin is in the UPPER RIGHT
            this.poColRect = new ColRect(pSprite.GetScreenRect());
            Debug.Assert(this.poColRect != null);

            // Create the box sprite

            //WORKING
            //this.pColSprite = BoxSpriteManager.Add(GameSprite.Name.Box, this.poColRect.x, this.poColRect.y, this.poColRect.width, this.poColRect.height);

            //TEST
            this.pColSprite = BoxSpriteManager.Add(pProxySprite.pSprite.GetName(), this.poColRect.x, this.poColRect.y, this.poColRect.width, this.poColRect.height);


            ////get the box name from the matching sprite name;
            //BoxSprite.Name colBoxName = (BoxSprite.Name) pProxySprite.pSprite.GetName();
            //Debug.Assert(colBoxName != null);
            //this.pColSprite = BoxSpriteManager.Find(colBoxName);
            //this.pColSprite.SetScreenRect(this.poColRect.x, this.poColRect.y, this.poColRect.width, this.poColRect.height);
            //Debug.Assert(this.pColSprite != null);

            this.pColSprite.SetLineColor(1.0f, 1.0f, 0.0f);
        }
Esempio n. 6
0
 public override void Wash()
 {
     this.x          = 0.0f;
     this.y          = 0.0f;
     this.name       = Name.Uninitialized;
     this.pBoxSprite = null;
 }
        override protected void derivedWash(DLink pLink)
        {
            Debug.Assert(pLink != null);
            BoxSprite pNode = (BoxSprite)pLink;

            pNode.Wash();
        }
Esempio n. 8
0
        protected override void derivedPrint(DLink pLink)
        {
            Debug.Assert(pLink != null);
            BoxSprite pBoxSprite = (BoxSprite)pLink;

            pBoxSprite.Print();
        }
        override protected void derivedDumpNode(DLink pLink)
        {
            Debug.Assert(pLink != null);
            BoxSprite pData = (BoxSprite)pLink;

            pData.Dump();
        }
Esempio n. 10
0
        public BoxSpriteMan(int reserveNum = 2, int growth = 1)
            : base()
        {
            base.BaseIntialize(reserveNum, growth);

            this.poNodeCompare = new BoxSprite();
        }
Esempio n. 11
0
        protected override void derivedWashNode(MLink pLink)
        {
            Debug.Assert(pLink != null);
            BoxSprite pNode = (BoxSprite)pLink;

            pNode.WashNodeData();
        }
Esempio n. 12
0
        protected override void DerivedWash(DLink pDLink)
        {
            Debug.Assert(pDLink != null);

            BoxSprite pBSnode = (BoxSprite)pDLink;

            pBSnode.Wash();
        }
Esempio n. 13
0
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        private BoxSpriteManager(int initReserve = 3, int growthRate = 1) : base()
        {
            // initializes the base class
            this.baseInitialize(initReserve, growthRate);

            // initializes the derived class
            this.poNodeCompare = new BoxSprite();
        }
Esempio n. 14
0
        public static void Remove(BoxSprite pSBnode)
        {
            BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pBSMan != null);

            pBSMan.BaseRemove(pSBnode);
        }
Esempio n. 15
0
        public static void Remove(BoxSprite pSprite)
        {
            Debug.Assert(pMan != null);
            Debug.Assert(pSprite != null);

            pMan.baseRemove(pSprite);
            pSprite.Wash();
        }
        //----------------------------------------------------------------------
        // Override Abstract methods
        //----------------------------------------------------------------------
        override protected DLink derivedCreateNode()
        {
            DLink pNode = new BoxSprite();

            Debug.Assert(pNode != null);

            return(pNode);
        }
Esempio n. 17
0
        protected override void DerivedDumpNode(DLink pDLink)
        {
            Debug.Assert(pDLink != null);

            BoxSprite pBSnode = (BoxSprite)pDLink;

            pBSnode.DumpBoxSprite();
        }
Esempio n. 18
0
        public static void Remove(BoxSprite pBoxSprite)
        {
            BoxSpriteManager pBoxMan = BoxSpriteManager.privGetInstance();

            Debug.Assert(pBoxMan != null);

            Debug.Assert(pBoxSprite != null);
            pBoxMan.baseRemove(pBoxSprite);
        }
Esempio n. 19
0
        //----------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------
        private BoxSpriteMan(int reserveNum = 3, int reserveGrow = 1)
            : base() // <--- Kick the can (delegate)
        {
            // At this point ImageMan is created, now initialize the reserve
            this.BaseInitialize(reserveNum, reserveGrow);

            // initialize derived data here
            this.poNodeCompare = new BoxSprite();
        }
        public static void Remove(BoxSprite pNode)
        {
            BoxSpriteMan pMan = BoxSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.baseRemove(pNode);
        }
Esempio n. 21
0
        public void UpdateAllActive()
        {
            BoxSprite current = (BoxSprite)this.poActiveHead;

            while (current != null)
            {
                current.Update();
                current = (BoxSprite)(current.pNext);
            }
        }
Esempio n. 22
0
        public ProxyBoxSprite()
            : base()
        {
            this.name = ProxyBoxSprite.Name.Uninitialized;

            this.x = 0.0f;
            this.y = 0.0f;

            this.pBoxSprite = null;
        }
Esempio n. 23
0
        public void RenderAllActive()
        {
            BoxSprite current = (BoxSprite)this.poActiveHead;

            while (current != null)
            {
                current.Render();
                current = (BoxSprite)(current.pNext);
            }
        }
Esempio n. 24
0
        public static void Remove(BoxSprite pBoxSprite)
        {
            //ensure call Create() first
            BoxSpriteMan pMan = BoxSpriteMan.GetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pBoxSprite != null);
            pMan.baseRemove(pBoxSprite);
        }
Esempio n. 25
0
        public void Set(BoxSprite.Name name)
        {
            this.name = ProxyBoxSprite.Name.Proxy;

            this.x = 0.0f;
            this.y = 0.0f;

            this.pBoxSprite = BoxSpriteManager.Find(name);
            Debug.Assert(this.pBoxSprite != null);
        }
Esempio n. 26
0
        public static void Remove(BoxSprite pNode)
        {
            //get the singleton
            BoxSpriteManager pMan = privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.baseRemoveNode(pNode);
        }
Esempio n. 27
0
        override protected Boolean DerivedCompare(DLink pLinkA, DLink pLinkB)
        {
            // This is used in baseFind()
            Debug.Assert(pLinkA != null);
            Debug.Assert(pLinkB != null);

            BoxSprite pDataA = (BoxSprite)pLinkA;
            BoxSprite pDataB = (BoxSprite)pLinkB;

            return(pDataA.name == pDataB.name);
        }
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteMan pMan = BoxSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.SetName(name);

            BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeCompare);

            return(pData);
        }
Esempio n. 29
0
        //----------------------------------------------------------------------
        // Override Abstract methods
        //----------------------------------------------------------------------
        protected override bool derivedCompare(DLink pNodeA, DLink pNodeB)
        {
            // ensure pNodeA & pNodeB are not null
            Debug.Assert(pNodeA != null);
            Debug.Assert(pNodeB != null);

            // cast DLink to concrete type BoxSprite
            BoxSprite pDataA = (BoxSprite)pNodeA;
            BoxSprite pDataB = (BoxSprite)pNodeB;

            return(pDataA.getName() == pDataB.getName());
        }
Esempio n. 30
0
        public static BoxSprite Find(BoxSprite.Name name)
        {
            //ensure call Create() first
            BoxSpriteMan pMan = BoxSpriteMan.GetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeForCompare.setName(name);
            BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeForCompare);

            return(pData);
        }