当前位置: 首页>>代码示例>>C#>>正文


C# BaseHouse.GetType方法代码示例

本文整理汇总了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;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:31,代码来源:ViewHousesGump.cs

示例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;
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:32,代码来源:HousePlacementTool.cs

示例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;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:30,代码来源:HousePlacementTool.cs


注:本文中的Server.Multis.BaseHouse.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。