refactoring, generics, a bug fix in mana drain, a few todos done

This commit is contained in:
mark 2007-01-20 20:39:55 +00:00
parent f95101c201
commit 50b59db594
9 changed files with 89 additions and 125 deletions

View file

@ -226,7 +226,7 @@ namespace Server.Mobiles
GenericBuyInfo buy = m_ArmorBuyInfo[i] as GenericBuyInfo;
if ( buy != null )
buy.DeleteDisplayObject();
buy.DeleteDisplayEntity();
}
SBInfos.Clear();
@ -560,7 +560,7 @@ namespace Server.Mobiles
// NOTE: Only GBI supported; if you use another implementation of IBuyItemInfo, this will crash
GenericBuyInfo gbi = (GenericBuyInfo) buyItem;
IEntity disp = gbi.GetDisplayObject() as IEntity;
IEntity disp = gbi.GetDisplayEntity();
list.Add( new BuyItemState( buyItem.Name, cont.Serial, disp == null ? (Serial) 0x7FC0FFEE : disp.Serial, buyItem.Price, buyItem.Amount, buyItem.ItemID, buyItem.Hue ) );
count++;
@ -765,11 +765,10 @@ namespace Server.Mobiles
{
IBuyItemInfo[] buyInfo = this.GetBuyInfo();
for ( int i = 0; i < buyInfo.Length; ++i )
{
GenericBuyInfo gbi = buyInfo[i] as GenericBuyInfo;
for ( int i = 0; i < buyInfo.Length; ++i ) {
GenericBuyInfo gbi = (GenericBuyInfo)buyInfo[i];
if ( gbi.GetDisplayObject() == obj )
if ( gbi.GetDisplayEntity() == obj )
return gbi;
}
@ -812,7 +811,7 @@ namespace Server.Mobiles
bii.Amount -= amount;
object o = bii.GetObject();
IEntity o = bii.GetEntity();
if ( o is Item )
{
@ -834,7 +833,7 @@ namespace Server.Mobiles
for (int i=1;i<amount;i++)
{
item = bii.GetObject() as Item;
item = bii.GetEntity() as Item;
if ( item != null )
{
@ -859,7 +858,7 @@ namespace Server.Mobiles
for ( int i = 1; i < amount; ++i )
{
m = bii.GetObject() as Mobile;
m = bii.GetEntity() as Mobile;
if ( m != null )
{
@ -1451,7 +1450,7 @@ namespace Server
public interface IBuyItemInfo
{
//get a new instance of an object (we just bought it)
object GetObject();
IEntity GetEntity();
int ControlSlots{ get; }