示例#1
0
        public ItemData GetObject(DungeonData d)
        {
            if (IsNull)
                return null;

            switch (Category)
            {
                case ObjectCategory.Actuators:
                    return d.Actuators[ObjectNumber];

                case ObjectCategory.Clothe:
                    return d.Clothes[ObjectNumber];

                case ObjectCategory.Container:
                    return d.Containers[ObjectNumber];

                case ObjectCategory.Creatures:
                    return d.Creatures[ObjectNumber];

                case ObjectCategory.Doors:
                    return d.Doors[ObjectNumber];

                case ObjectCategory.Miscellenaous:
                    return d.MiscellaneousItems[ObjectNumber];

                case ObjectCategory.Potion:
                    return d.Potions[ObjectNumber];

                case ObjectCategory.Scroll:
                    return d.Scrolls[ObjectNumber];

                case ObjectCategory.Teleporters:
                    return d.Teleports[ObjectNumber];

                case ObjectCategory.WallTextsAndMessages:
                    return d.Texts[ObjectNumber];

                case ObjectCategory.Weapon:
                    return d.Weapons[ObjectNumber];

                default:
                    return null;
            }
        }
示例#2
0
 private static void a(DungeonMap map, DungeonData data)
 {
     //from i in map.Tiles.SelectMany(x => x.GetItems(data)) where i.GetType() == typeof(WeaponItem) && ((WeaponItem)i).ItemTypeIndex == 9 select i
     for (int i = 0; i < map.Tiles.Count; i++)
     {
         foreach (var k in map.Tiles[i].GetItems(data))
             if (k.GetType() == typeof(WeaponItemData) && ((WeaponItemData)k).ItemTypeIndex == 9)
             {
                 Console.WriteLine("{0} | {1} {2} ", i, i / map.Height, i % map.Height);
                 break;
             }
     }
 }