misc generic conversions
This commit is contained in:
parent
d567869eb8
commit
28744d486e
14 changed files with 91 additions and 71 deletions
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
|
|
@ -11,7 +11,7 @@ namespace Server
|
|||
|
||||
public class VirtueGump : Gump
|
||||
{
|
||||
private static Hashtable m_Callbacks = new Hashtable();
|
||||
private static Dictionary<int, OnVirtueUsed> m_Callbacks = new Dictionary<int, OnVirtueUsed>();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -38,7 +38,9 @@ namespace Server
|
|||
return;
|
||||
}
|
||||
|
||||
OnVirtueUsed callback = (OnVirtueUsed)m_Callbacks[e.GumpID];
|
||||
OnVirtueUsed callback = null;
|
||||
|
||||
m_Callbacks.TryGetValue(e.GumpID, out callback);
|
||||
|
||||
if ( callback != null )
|
||||
callback( e.Beholder );
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Commands.Generic;
|
||||
using Server.Network;
|
||||
|
|
@ -11,6 +12,18 @@ using CPA = Server.CommandPropertyAttribute;
|
|||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class StackEntry
|
||||
{
|
||||
public object m_Object;
|
||||
public PropertyInfo m_Property;
|
||||
|
||||
public StackEntry(object obj, PropertyInfo prop)
|
||||
{
|
||||
m_Object = obj;
|
||||
m_Property = prop;
|
||||
}
|
||||
}
|
||||
|
||||
public class PropertiesGump : Gump
|
||||
{
|
||||
private ArrayList m_List;
|
||||
|
|
@ -18,7 +31,7 @@ namespace Server.Gumps
|
|||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Type m_Type;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
|
||||
public static readonly bool OldStyle = PropsConfig.OldStyle;
|
||||
|
||||
|
|
@ -86,7 +99,7 @@ namespace Server.Gumps
|
|||
Initialize( 0 );
|
||||
}
|
||||
|
||||
public PropertiesGump( Mobile mobile, object o, Stack stack, StackEntry parent ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public PropertiesGump( Mobile mobile, object o, Stack<StackEntry> stack, StackEntry parent ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Object = o;
|
||||
|
|
@ -97,7 +110,7 @@ namespace Server.Gumps
|
|||
if ( parent != null )
|
||||
{
|
||||
if ( m_Stack == null )
|
||||
m_Stack = new Stack();
|
||||
m_Stack = new Stack<StackEntry>();
|
||||
|
||||
m_Stack.Push( parent );
|
||||
}
|
||||
|
|
@ -105,7 +118,7 @@ namespace Server.Gumps
|
|||
Initialize( 0 );
|
||||
}
|
||||
|
||||
public PropertiesGump( Mobile mobile, object o, Stack stack, ArrayList list, int page ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public PropertiesGump( Mobile mobile, object o, Stack<StackEntry> stack, ArrayList list, int page ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
m_Object = o;
|
||||
|
|
@ -231,18 +244,6 @@ namespace Server.Gumps
|
|||
public static string[] m_PoisonNames = new string[]{ "None", "Lesser", "Regular", "Greater", "Deadly", "Lethal" };
|
||||
public static object[] m_PoisonValues = new object[]{ null, Poison.Lesser, Poison.Regular, Poison.Greater, Poison.Deadly, Poison.Lethal };
|
||||
|
||||
public class StackEntry
|
||||
{
|
||||
public object m_Object;
|
||||
public PropertyInfo m_Property;
|
||||
|
||||
public StackEntry( object obj, PropertyInfo prop )
|
||||
{
|
||||
m_Object = obj;
|
||||
m_Property = prop;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
|
@ -259,7 +260,7 @@ namespace Server.Gumps
|
|||
{
|
||||
if ( m_Stack != null && m_Stack.Count > 0 )
|
||||
{
|
||||
StackEntry entry = (StackEntry)m_Stack.Pop();
|
||||
StackEntry entry = m_Stack.Pop();
|
||||
|
||||
from.SendGump( new PropertiesGump( from, entry.m_Object, m_Stack, null ) );
|
||||
}
|
||||
|
|
@ -356,7 +357,7 @@ namespace Server.Gumps
|
|||
return type.IsDefined( typeofCustomEnum, false );
|
||||
}
|
||||
|
||||
public static void OnValueChanged( object obj, PropertyInfo prop, Stack stack )
|
||||
public static void OnValueChanged( object obj, PropertyInfo prop, Stack<StackEntry> stack )
|
||||
{
|
||||
if ( stack == null || stack.Count == 0 )
|
||||
return;
|
||||
|
|
@ -364,7 +365,7 @@ namespace Server.Gumps
|
|||
if ( !prop.PropertyType.IsValueType )
|
||||
return;
|
||||
|
||||
StackEntry peek = (StackEntry)stack.Peek();
|
||||
StackEntry peek = stack.Peek();
|
||||
|
||||
if ( peek.m_Property.CanWrite )
|
||||
peek.m_Property.SetValue( peek.m_Object, obj, null );
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.HuePickers;
|
||||
|
|
@ -14,7 +14,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
private int m_OurPage;
|
||||
|
|
@ -25,7 +25,7 @@ namespace Server.Gumps
|
|||
private const int SelectedColor32 = 0x8080FF;
|
||||
private const int TextColor32 = 0xFFFFFF;
|
||||
|
||||
public SetBodyGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list )
|
||||
public SetBodyGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list )
|
||||
: this( prop, mobile, o, stack, page, list, 0, null, ModelBodyType.Invalid )
|
||||
{
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ namespace Server.Gumps
|
|||
AddHtml( x + 35, y, 200, 20, Color( text, isSelection ? SelectedColor32 : LabelColor32 ), false, false );
|
||||
}
|
||||
|
||||
public SetBodyGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list, int ourPage, ArrayList ourList, ModelBodyType ourType )
|
||||
public SetBodyGump(PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list, int ourPage, ArrayList ourList, ModelBodyType ourType)
|
||||
: base( 20, 30 )
|
||||
{
|
||||
m_Property = prop;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
|
@ -11,7 +12,7 @@ namespace Server.Gumps
|
|||
{
|
||||
private string[] m_Names;
|
||||
|
||||
public SetCustomEnumGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int propspage, ArrayList list, string[] names ) : base( prop, mobile, o, stack, propspage, list, names, null )
|
||||
public SetCustomEnumGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int propspage, ArrayList list, string[] names ) : base( prop, mobile, o, stack, propspage, list, names, null )
|
||||
{
|
||||
m_Names = names;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.HuePickers;
|
||||
|
|
@ -13,7 +14,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ namespace Server.Gumps
|
|||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
|
||||
public SetGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
@ -160,11 +161,11 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
public InternalPicker( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( ((IHued)o).HuedItemID )
|
||||
public InternalPicker( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( ((IHued)o).HuedItemID )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
|
@ -12,7 +13,7 @@ namespace Server.Gumps
|
|||
protected PropertyInfo m_Property;
|
||||
protected Mobile m_Mobile;
|
||||
protected object m_Object;
|
||||
protected Stack m_Stack;
|
||||
protected Stack<StackEntry> m_Stack;
|
||||
protected int m_Page;
|
||||
protected ArrayList m_List;
|
||||
|
||||
|
|
@ -67,7 +68,7 @@ namespace Server.Gumps
|
|||
|
||||
protected object[] m_Values;
|
||||
|
||||
public SetListOptionGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int propspage, ArrayList list, string[] names, object[] values ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetListOptionGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int propspage, ArrayList list, string[] names, object[] values ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Commands.Generic;
|
||||
using Server.Network;
|
||||
|
|
@ -14,7 +15,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private Type m_Type;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
|
@ -61,7 +62,7 @@ namespace Server.Gumps
|
|||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
|
||||
public SetObjectGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, Type type, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetObjectGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, Type type, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
@ -142,12 +143,12 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private Type m_Type;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
public InternalPrompt( PropertyInfo prop, Mobile mobile, object o, Stack stack, Type type, int page, ArrayList list )
|
||||
public InternalPrompt( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, Type type, int page, ArrayList list )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
|
@ -13,12 +14,12 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private Type m_Type;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
public SetObjectTarget( PropertyInfo prop, Mobile mobile, object o, Stack stack, Type type, int page, ArrayList list ) : base( -1, false, TargetFlags.None )
|
||||
public SetObjectTarget( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, Type type, int page, ArrayList list ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
|
@ -13,7 +14,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
|
|
@ -60,7 +61,7 @@ namespace Server.Gumps
|
|||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
|
||||
public SetPoint2DGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetPoint2DGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
@ -131,11 +132,11 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
public InternalTarget( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( -1, true, TargetFlags.None )
|
||||
public InternalTarget( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
|
@ -13,7 +14,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
|
|
@ -60,7 +61,7 @@ namespace Server.Gumps
|
|||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
|
||||
public SetPoint3DGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetPoint3DGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
@ -136,11 +137,11 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
public InternalTarget( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( -1, true, TargetFlags.None )
|
||||
public InternalTarget( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
|
@ -12,7 +13,7 @@ namespace Server.Gumps
|
|||
private PropertyInfo m_Property;
|
||||
private Mobile m_Mobile;
|
||||
private object m_Object;
|
||||
private Stack m_Stack;
|
||||
private Stack<StackEntry> m_Stack;
|
||||
private int m_Page;
|
||||
private ArrayList m_List;
|
||||
|
||||
|
|
@ -58,7 +59,7 @@ namespace Server.Gumps
|
|||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
|
||||
public SetTimeSpanGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
public SetTimeSpanGump( PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, ArrayList list ) : base( GumpOffsetX, GumpOffsetY )
|
||||
{
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
|
|
|
|||
|
|
@ -2028,7 +2028,7 @@ namespace Server.Mobiles
|
|||
return (res == MoveResult.Success || res == MoveResult.SuccessAutoTurn || (badStateOk && res == MoveResult.BadState));
|
||||
}
|
||||
|
||||
private static Queue m_Obstacles = new Queue();
|
||||
private static Queue<Item> m_Obstacles = new Queue<Item>();
|
||||
|
||||
public virtual MoveResult DoMoveImpl(Direction d)
|
||||
{
|
||||
|
|
@ -2117,7 +2117,7 @@ namespace Server.Mobiles
|
|||
|
||||
while (m_Obstacles.Count > 0)
|
||||
{
|
||||
Item item = (Item)m_Obstacles.Dequeue();
|
||||
Item item = m_Obstacles.Dequeue();
|
||||
|
||||
if (item is BaseDoor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
|
@ -424,7 +425,7 @@ namespace Server.SkillHandlers
|
|||
m_Expires = DateTime.UtcNow + StealTime;
|
||||
}
|
||||
|
||||
private static Queue m_Queue = new Queue();
|
||||
private static Queue<StolenItem> m_Queue = new Queue<StolenItem>();
|
||||
|
||||
public static void Add( Item item, Mobile thief, Mobile victim )
|
||||
{
|
||||
|
|
@ -478,7 +479,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
while ( m_Queue.Count > 0 )
|
||||
{
|
||||
StolenItem si = (StolenItem) m_Queue.Peek();
|
||||
StolenItem si = m_Queue.Peek();
|
||||
|
||||
if ( si.IsExpired )
|
||||
m_Queue.Dequeue();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue