本文整理匯總了C#中Server.Multis.BaseHouse.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseHouse.GetType方法的具體用法?C# BaseHouse.GetType怎麽用?C# BaseHouse.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Multis.BaseHouse
的用法示例。
在下文中一共展示了BaseHouse.GetType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FindHouseName
public object FindHouseName( BaseHouse house )
{
int multiID = house.ItemID & 0x3FFF;
HousePlacementEntry[] entries;
entries = HousePlacementEntry.ClassicHouses;
for ( int i = 0; i < entries.Length; ++i )
{
if ( entries[i].MultiID == multiID )
return entries[i].Description;
}
entries = HousePlacementEntry.TwoStoryFoundations;
for ( int i = 0; i < entries.Length; ++i )
{
if ( entries[i].MultiID == multiID )
return entries[i].Description;
}
entries = HousePlacementEntry.ThreeStoryFoundations;
for ( int i = 0; i < entries.Length; ++i )
{
if ( entries[i].MultiID == multiID )
return entries[i].Description;
}
return house.GetType().Name;
}
示例2: Find
public static HousePlacementEntry Find( BaseHouse house )
{
object obj = m_Table[house.GetType()];
if ( obj is HousePlacementEntry )
{
return ((HousePlacementEntry)obj);
}
else if ( obj is ArrayList )
{
ArrayList list = (ArrayList)obj;
for ( int i = 0; i < list.Count; ++i )
{
HousePlacementEntry e = (HousePlacementEntry)list[i];
if ( e.m_MultiID == (house.ItemID & 0x3FFF) )
return e;
}
}
else if ( obj is Hashtable )
{
Hashtable table = (Hashtable)obj;
obj = table[house.ItemID & 0x3FFF];
if ( obj is HousePlacementEntry )
return (HousePlacementEntry)obj;
}
return null;
}
示例3: Find
public static HousePlacementEntry Find(BaseHouse house)
{
object obj = m_Table[house.GetType()];
if (obj is HousePlacementEntry)
{
return ((HousePlacementEntry)obj);
}
if (obj is ArrayList)
{
var list = (ArrayList)obj;
return list.Cast<HousePlacementEntry>().FirstOrDefault(e => e.MultiID == house.ItemID);
}
if (obj is Hashtable)
{
var table = (Hashtable)obj;
obj = table[house.ItemID];
if (obj is HousePlacementEntry)
{
return (HousePlacementEntry)obj;
}
}
return null;
}