public void Add(Gump gump) { lock (mySyncRoot) { if (!myGumpList.ContainsKey(gump.ID)) { myGumpList.Add(gump.ID, gump); OnCollectionChanged(); } } }
public bool FindGump(int serial, out Gump gump) { lock (mySyncRoot) { foreach (KeyValuePair<int, Gump> kvp in myGumpList) { if (kvp.Value.Serial == serial) { gump = kvp.Value; return true; } } } gump = null; return false; }
public GumpWriter(Gump g) { m_Stream = new PacketWriter( 4096 ); m_Buffer[0] = (byte) ' '; m_Stream.Write( (byte) 0xB0 ); m_Stream.Write( (short) 0 ); m_Stream.Write( (int) g.Serial ); m_Stream.Write( (int) g.ID ); m_Stream.Write( (int) g.X ); m_Stream.Write( (int) g.Y ); m_Stream.Write( (ushort) 0xFFFF ); }
public bool GetGump(int ID, out Gump gump) { lock (mySyncRoot) { return myGumpList.TryGetValue(ID, out gump); } }
public bool GetGumps(out Gump[] gumps) { lock (mySyncRoot) { if (myGumpList.Values.Count > 0) { gumps = new Gump[myGumpList.Values.Count]; myGumpList.Values.CopyTo(gumps, 0); return true; } } gumps = null; return false; }