CODE |
+ Custom/Engines/XML Spawner [2.0] Version 3.12/XmlSpawnerGumps.cs: CS0117: Line 989: 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump> ' does not contain a definition for 'Count' CS0021: Line 991: Cannot apply indexing with [] to an expression of type 'Sy stem.Collections.Generic.IEnumerable<Server.Gumps.Gump>' CS0117: Line 1022: 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump >' does not contain a definition for 'Remove' |
CODE |
public static void RefreshSpawnerGumps( Mobile from ) { if(from == null) return; NetState ns = from.NetState; if ( ns != null && ns.Gumps != null) { //ArrayList current = new ArrayList(); List<Gump> current = new List<Gump>(); for ( int i = 0; i < ns.Gumps.Count; ++i )//Line 989 { current.Add(ns.Gumps[i]);//Line 991 } // close all of the currently opened spawner gumps from.CloseGump(typeof(XmlSpawnerGump)); ArrayList refresh = new ArrayList(); for ( int i = 0; i < current.Count; ++i ) { Gump g = (Gump)current[i]; if(g is XmlSpawnerGump) { XmlSpawnerGump xg = (XmlSpawnerGump)g; // clear the gump status on the spawner associated with the gump if(xg.m_Spawner != null) { // and add the old gump to the removal list refresh.Add(xg); } } } // remove the closed gumps from the gump collection foreach(XmlSpawnerGump g in refresh) { ns.Gumps.Remove(g);//Line 1022 } // reopen the closed gumps from the gump collection foreach(XmlSpawnerGump g in refresh) { // reopen a new gump for the spawner if(g.m_Spawner != null && g.m_Spawner.SpawnerGump == g) { // flag the current gump on the spawner as closed g.m_Spawner.GumpReset = true; XmlSpawnerGump xg = new XmlSpawnerGump(g.m_Spawner, g.X, g.Y, g.m_ShowGump,g.xoffset, g.page, g.Rentry); from.SendGump(xg ); } } } } |