public void DumpNodeData() { // we are using HASH code as its unique identifier Debug.WriteLine("FontNode: {0}, hashcode: ({1})", this.name, this.GetHashCode()); if (this.pMNext == null) { Debug.WriteLine(" next: null"); } else { FontNode pTmp = (FontNode)this.pMNext; Debug.WriteLine(" next: {0}, hashcode: ({1})", pTmp.name, pTmp.GetHashCode()); } if (this.pMPrev == null) { Debug.WriteLine(" prev: null"); } else { FontNode pTmp = (FontNode)this.pMPrev; Debug.WriteLine(" prev: {0}, hashcode: ({1})", pTmp.name, pTmp.GetHashCode()); } // Print Unique Node Data: Debug.WriteLine(" FontNode Name: {0}", this.name); }
protected override void derivedWashNode(MLink pLink) { Debug.Assert(pLink != null); FontNode pNode = (FontNode)pLink; pNode.WashNodeData(); }
protected override MLink derivedCreateNode() { MLink pNode = new FontNode(); Debug.Assert(pNode != null); return(pNode); }
public static void Remove(FontNode pNode) { //get the singleton FontManager pMan = privGetInstance(); Debug.Assert(pMan != null); Debug.Assert(pNode != null); pMan.baseRemoveNode(pNode); }
public static FontNode Find(FontNode.Name name) { //get the singleton FontManager pMan = privGetInstance(); // Compare functions only compares two Nodes pMan.pRefNode.SetName(name); FontNode pData = (FontNode)pMan.baseFindNode(pMan.pRefNode); return(pData); }
//---------------------------------------------------------------------- // Override Abstract methods //---------------------------------------------------------------------- //EDIT THE FOLLOWING METHODS--------------------- protected override Boolean derivedCompareNodes(MLink pLinkA, MLink pLinkB) { // This is used in baseFindNode() Debug.Assert(pLinkA != null); Debug.Assert(pLinkB != null); FontNode pDataA = (FontNode)pLinkA; FontNode pDataB = (FontNode)pLinkB; Boolean status = false; if (pDataA.GetName() == pDataB.GetName()) { status = true; } return(status); }
//---------------------------------------------------------------------- // 4 Wrapper methods: baseAdd, baseFind, baseRemove, baseDump //---------------------------------------------------------------------- public static FontNode Add(FontNode.Name name, SpriteBatch.Name SB_Name, String pMessage, Glyph.Name glyphName, float xStart, float yStart) { FontManager pMan = FontManager.privGetInstance(); FontNode pNode = (FontNode)pMan.baseAddToFront(); Debug.Assert(pNode != null); pNode.Set(name, pMessage, glyphName, xStart, yStart); // Add to sprite batch SpriteBatch pSB = SpriteBatchManager.Find(SB_Name); Debug.Assert(pSB != null); Debug.Assert(pNode.pFontSprite != null); pSB.Attach(pNode.pFontSprite); return(pNode); }
//---------------------------------------------------------------------- // Constructor - Singleton Instantiation //---------------------------------------------------------------------- private FontManager(int startReserveSize = 3, int refillSize = 1) : base(startReserveSize, refillSize) { /*delegate to parent manager*/ this.pRefNode = (FontNode)this.derivedCreateNode(); }