當前位置: 首頁>>代碼示例>>C#>>正文


C# ItemLists.ItemListEntry類代碼示例

本文整理匯總了C#中Server.Menus.ItemLists.ItemListEntry的典型用法代碼示例。如果您正苦於以下問題:C# ItemListEntry類的具體用法?C# ItemListEntry怎麽用?C# ItemListEntry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ItemListEntry類屬於Server.Menus.ItemLists命名空間,在下文中一共展示了ItemListEntry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Eighth

        public static ItemListEntry[] Eighth(Mobile from)
        {
            Type type;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            bool hasres = true;
            int missing = 0;
            ItemListEntry[] entries = new ItemListEntry[8];

            for (int i = 0; i < 8; ++i)
            {
                Type reg = null;
                type = DefInscription.CraftSystem.CraftItems.GetAt(i + 56).ItemType;
                chance = DefInscription.CraftSystem.CraftItems.GetAt(i + 56).GetSuccessChance(from, DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0).ItemType, DefInscription.CraftSystem, false, ref allRequiredSkills);
                craftResource = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                int size = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.Count;
                hasres = true;

                /*for (int j = 0; j < size; ++j)
                {
                    reg = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).ItemType;
                    if ((from.Backpack.GetAmount(reg) < DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).Amount) && hasres)
                    {
                        hasres = false;
                    }
                }*/

                if ((chance > 0) && hasres && GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i+56).ItemType))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("Scroll", "");
                    name = name.Replace("yV", "y V");
                    name = name.Replace("nA", "n A");
                    name = name.Replace("nE", "n E");
                    name = name.Replace("nF", "n F");
                    name = name.Replace("nW", "n W");
                    name = name.Replace("nD", "n D");
                    name = name.Replace("rE", "r E");
                    name = name.Replace("hE", "h E");
                    name = name.Replace("eE", "e E");
                    //name = name.ToLower();

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name), 8320 + i + 56,0,i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing]= new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:60,代碼來源:InscriptionMenu.cs

示例2: CartographyMenu

 public CartographyMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Attempt what scale of map?", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:8,代碼來源:CartographyMenu.cs

示例3: BlacksmithMenu

 public BlacksmithMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("What would you like to make?", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
開發者ID:Godkong,項目名稱:Origins,代碼行數:8,代碼來源:BlacksmithMenu.cs

示例4: TinkeringMenu

 public TinkeringMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Choose an item.", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
開發者ID:Godkong,項目名稱:Origins,代碼行數:8,代碼來源:TinkingMenu.cs

示例5: AlchemyMenu

 public AlchemyMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Choose a formula.", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
開發者ID:Godkong,項目名稱:Origins,代碼行數:8,代碼來源:AlchemyMenu.cs

示例6: Main

        //MAIN
        public static ItemListEntry[] Main(Mobile from)
        {
            bool Shields = true;
            bool Armor = true;
            bool Weapons = true;
            int missing = 0;

            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance;

            //Shields
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //WoodenKiteShield
            {
                Shields = false;
            }

            //Armor
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //RingmailGloves
            {
                Armor = false;
            }

            //Weapons
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Weapons = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            entries[0] = new ItemListEntry("Repair", 4015, 0, 0);

            if (Shields)
                entries[1-missing] = new ItemListEntry("Shields", 7026, 0, 1);
            else
                missing++;// entries[1] = new ItemListEntry("", -1);

            if (Armor)
                entries[2 - missing] = new ItemListEntry("Armor", 5141, 0, 2);
            else
                missing++;// entries[2] = new ItemListEntry("", -1);

            if (Weapons)
                entries[3 - missing] = new ItemListEntry("Weapons", 5049, 0, 3);
            else
                missing++;// entries[3] = new ItemListEntry("", -1);

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:57,代碼來源:BlacksmithMenu.cs

示例7: Chairs

        public static ItemListEntry[] Chairs(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount = 0;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[9];

            for (int i = 0; i < 9; ++i)
            {
                chance = DefCarpentry.CraftSystem.CraftItems.GetAt(i+6).GetSuccessChance(from, typeof(Board), DefCarpentry.CraftSystem, false, ref allRequiredSkills);
                type = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 6).ItemType;
                craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

                if ((chance > 0) && (ResAmount >= craftResource.Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("tS", "t S");
                    name = name.Replace("oC", "o C");
                    name = name.Replace("nC", "n C");
                    name = name.Replace("nB", "n B");
                    name = name.Replace("nT", "n T");
                    name = name.ToLower();
                    if (name == "fancywooden chaircushion")
                        name = "wooden chair";
                    if (name == "wooden chaircushion")
                        name = "wooden chair";

                    itemid = item.ItemID;
                    /*if (itemid == 2903)
                        itemid--;*/

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} wood)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i]= new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:54,代碼來源:CarpentryMenu.cs

示例8: Main

        public static ItemListEntry[] Main(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[DefCartography.CraftSystem.CraftItems.Count];

            for (int i = 0; i < DefCartography.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefCartography.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(BlankMap), DefCartography.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type = DefCartography.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefCartography.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("lM", "l M");
                    name = name.Replace("yM", "y M");
                    name = name.Replace("aC", "a C");
                    name = name.Replace("dM", "d M");
                    name = name.Replace("local map", "A map of the local environs.");
                    name = name.Replace("city map", "A map of suitable for cities.");
                    name = name.Replace("sea chart", "A moderately sized sea chart.");
                    name = name.Replace("world map", "A map of the world.");
                    name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name), 6511 + i,0,i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:50,代碼來源:CartographyMenu.cs

示例9: Main

        public static ItemListEntry[] Main()
        {
            PolymorphCategory cat = (PolymorphCategory)Categories[0];
            ItemListEntry[] entries = new ItemListEntry[cat.Entries.Length];

            for (int i = 0; i < cat.Entries.Length; i++)
            {
                PolymorphEntry entry = (PolymorphEntry)cat.Entries[i];

                entries[i] = new ItemListEntry(entry.StringName, entry.ArtID);
            }

            return entries;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:14,代碼來源:PolymorphMenu.cs

示例10: ItemListMenu

		public ItemListMenu(string question, ItemListEntry[] entries)
		{
			m_Question = question;
			m_Entries = entries;

			do
			{
				m_Serial = m_NextSerial++;
				m_Serial &= 0x7FFFFFFF;
			}
			while (m_Serial == 0);

			m_Serial = (int)((uint)m_Serial | 0x80000000);
		}
開發者ID:zerodowned,項目名稱:JustUO-merged-with-EC-Support,代碼行數:14,代碼來源:ItemListMenu.cs

示例11: Arrows

        public static ItemListEntry[] Arrows(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount = 0;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[DefBowFletching.CraftSystem.CraftItems.Count];
            for (int i = 0; i < DefBowFletching.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefBowFletching.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(Log), DefBowFletching.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type = DefBowFletching.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefBowFletching.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.ToLower();
                    itemid = item.ItemID;

                    if (i == 2 || i == 3)
                        entries[i-missing] = new ItemListEntry(String.Format("{0}s", name), itemid, 0, i);
                    else
                        missing++;//entries[i-missing] = new ItemListEntry("", -1);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (DefBowFletching.CraftSystem.CraftItems.Count - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:43,代碼來源:BowcraftFletchingMenu.cs

示例12: Bolt

        public static ItemListEntry[] Bolt(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[3];

            for (int i = 0; i < 3; ++i)
            {
                chance = DefTailoring.CraftSystem.CraftItems.GetAt(i + 14).GetSuccessChance(from, typeof(Cloth), DefTailoring.CraftSystem, false, ref allRequiredSkills);
                type = DefTailoring.CraftSystem.CraftItems.GetAt(i + 14).ItemType;
                craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(Cloth)) >= (craftResource).Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("tO", "t O");
                    name = name.Replace("fC", "f C");
                    name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} cloth)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:43,代碼來源:TailoringMenu.cs

示例13: Agility

        public static ItemListEntry[] Agility(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[2];

            for (int i = 0; i < 2; ++i)
            {
                chance = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 2).GetSuccessChance(from, typeof(Bloodmoss), DefAlchemy.CraftSystem, false, ref allRequiredSkills);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(Bloodmoss)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(i+2).ItemType).Ressources.GetAt(0).Amount))
                {
                    type = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 2).ItemType;
                    craftResource = DefAlchemy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("rA", "r A");
                    name = name.Replace("yP", "y P");
                    name = name.Replace(" Potion", "");
                    //name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:43,代碼來源:AlchemyMenu.cs

示例14: Weapons

        //WEAPONS
        private static ItemListEntry[] Weapons(Mobile from)
        {
            bool Swords = true;
            bool Axes = true;
            bool Maces = true;
            bool Polearms = true;
            int missing = 0;

            CraftRes craftResource;
            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance;

            //Swords
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Swords = false;
            }
            //Axes
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Double Axe
            {
                Axes = false;
            }
            //Maces
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Mace
            {
                Maces = false;
            }
            //Polearms
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Spear
            {
                Polearms = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            if (Swords)
                entries[0-missing] = new ItemListEntry("Swords & Blades", 5049, 0, 0);
            else
                missing++;//entries[0] = new ItemListEntry("", -1);

            if (Axes)
                entries[1 - missing] = new ItemListEntry("Axes", 3913, 0, 1);
            else
                missing++;//entries[1] = new ItemListEntry("", -1);

            if (Maces)
                entries[2 - missing] = new ItemListEntry("Maces & Hammers", 5127, 0, 2);
            else
                missing++;//entries[2] = new ItemListEntry("", -1);

            if (Polearms)
                entries[3-missing] = new ItemListEntry("Polearms", 3917, 0, 3);
            else
                missing++;//entries[3] = new ItemListEntry("", -1);

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:66,代碼來源:BlacksmithMenu.cs

示例15: Shields

        //SHEILDS
        private static ItemListEntry[] Shields(Mobile from)
        {
            Type type;
            Item item = null;
            int itemid;
            string name;
            int missing = 0;

            CraftRes craftResource;
            int resHue = 0;
            int maxAmount = 0;
            Object message = null;

            bool allRequiredSkills = true;
            double chance;

            ItemListEntry[] entries = new ItemListEntry[6];

            for (int i = 0; i < 6; ++i)
            {
                type = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType;
                craftResource = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);

                if ((from.Backpack.GetAmount(typeof(IronIngot)) >= DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType).Ressources.GetAt(0).Amount) && (chance > 0.0))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("S", " S");
                    name = name.Replace("K", " K");
                    name = name.ToLower();
                    itemid = item.ItemID;
                    if (itemid == 7033)
                        itemid = 7032;

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} ingots)", name, craftResource.Amount), itemid, 0, i);
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }

                if (item != null)
                    item.Delete();
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:52,代碼來源:BlacksmithMenu.cs


注:本文中的Server.Menus.ItemLists.ItemListEntry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。