Пример #1
0
 public static Item GenerateItem(Character player)
 {
     int caseFactor = new Random().Next(1, 5);
     switch (caseFactor)
     {
         case 1:
             return new Axe("CommonAxe", player);
         case 2:
             return new Shield("CommonShield", player);
         case 3:
             return new Staff("CommonStaff", player);
         case 4:
             return new Sword("CommonSword", player);
     }
     return null;
 }
Пример #2
0
 private void Initialize()
 {
     this.player = new Mage("Mage", 10, 10);
 }
Пример #3
0
 public void EquipItem(Character itemHolder)
 {
     Item item = ItemGenerator.GenerateItem();
     itemHolder.Equip(item);
 }