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()); } }
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()); } }
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()); } }
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); }
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(); }
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(); }
public BoxSpriteMan(int reserveNum = 2, int growth = 1) : base() { base.BaseIntialize(reserveNum, growth); this.poNodeCompare = new BoxSprite(); }
protected override void derivedWashNode(MLink pLink) { Debug.Assert(pLink != null); BoxSprite pNode = (BoxSprite)pLink; pNode.WashNodeData(); }
protected override void DerivedWash(DLink pDLink) { Debug.Assert(pDLink != null); BoxSprite pBSnode = (BoxSprite)pDLink; pBSnode.Wash(); }
//---------------------------------------------------------------------------------- // 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(); }
public static void Remove(BoxSprite pSBnode) { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); pBSMan.BaseRemove(pSBnode); }
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); }
protected override void DerivedDumpNode(DLink pDLink) { Debug.Assert(pDLink != null); BoxSprite pBSnode = (BoxSprite)pDLink; pBSnode.DumpBoxSprite(); }
public static void Remove(BoxSprite pBoxSprite) { BoxSpriteManager pBoxMan = BoxSpriteManager.privGetInstance(); Debug.Assert(pBoxMan != null); Debug.Assert(pBoxSprite != null); pBoxMan.baseRemove(pBoxSprite); }
//---------------------------------------------------------------------- // 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); }
public void UpdateAllActive() { BoxSprite current = (BoxSprite)this.poActiveHead; while (current != null) { current.Update(); current = (BoxSprite)(current.pNext); } }
public ProxyBoxSprite() : base() { this.name = ProxyBoxSprite.Name.Uninitialized; this.x = 0.0f; this.y = 0.0f; this.pBoxSprite = null; }
public void RenderAllActive() { BoxSprite current = (BoxSprite)this.poActiveHead; while (current != null) { current.Render(); current = (BoxSprite)(current.pNext); } }
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); }
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); }
public static void Remove(BoxSprite pNode) { //get the singleton BoxSpriteManager pMan = privGetInstance(); Debug.Assert(pMan != null); Debug.Assert(pNode != null); pMan.baseRemoveNode(pNode); }
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); }
//---------------------------------------------------------------------- // 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()); }
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); }