本文整理汇总了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;
}