當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。