Beispiel #1
0
 private static Item FindItem(int itemId, Inventar from)
 {
     foreach (var i in from.Items)
     {
         if (i.Id == itemId)
         {
             return(i);
         }
     }
     return(null);
 }
Beispiel #2
0
 public Character(int id, string name, string desc, int gold, int level, double maxHp, double hp, double maxMp, double mp, double hpRegen, double mpRegen, CharacterTypeEnum characterType, Inventar inventar) : base(id, name, desc)
 {
     Gold          = gold;
     Level         = level;
     MaxHp         = maxHp;
     Hp            = hp;
     MaxMp         = maxMp;
     Mp            = mp;
     HpRegen       = hpRegen;
     MpRegen       = mpRegen;
     CharacterType = characterType;
     Inventar      = inventar;
     inTheMind     = true;
 }
Beispiel #3
0
 public Character(int id, string name, string desc, int gold, int level, double experience, double experienceGained, double maxHp, double hp, double maxMp, double mp, double armor, double damage, double hpRegen, double mpRegen, CharacterTypeEnum characterType, Inventar inventar) : base(id, name, desc)
 {
     Gold             = gold;
     Level            = level;
     Experience       = experience;
     ExperienceGained = experienceGained;
     MaxHp            = maxHp;
     Hp            = hp;
     MaxMp         = maxMp;
     Mp            = mp;
     Armor         = armor;
     Damage        = damage;
     HpRegen       = hpRegen;
     MpRegen       = mpRegen;
     CharacterType = characterType;
     Inventar      = inventar;
     inTheMind     = true;
 }
Beispiel #4
0
        public static void RenderItem(Inventar from, Inventar to, int itemId) //передача предмета из инвентаря в инвентарь
        {
            Item item = FindItem(itemId, from);

            if (from.Items.IndexOf(item) != -1)
            {
                if (to.Items.Count < Inventar.MAX_ITEMS)
                {
                    to.AddItem(item);
                    from.RemoveItem(itemId);
                    Console.WriteLine("Обмен завершен!");
                }
                else
                {
                    Console.WriteLine("У принимателя не достаточно места!");
                }
            }
            else
            {
                Console.WriteLine("У вас нет в инвентаре этой вещи!");
            }
        }
Beispiel #5
0
 public Rogue(int id, string name, string desc, int gold, int level, double experience, double experienceGained, double maxHp, double hp, double maxMp, double mp, double armor, double damage, double hpRegen, double mpRegen, CharacterTypeEnum characterType, Inventar inventar) : base(id, name, desc, gold, level, experience, experienceGained, maxHp, hp, maxMp, mp, armor, damage, hpRegen, mpRegen, characterType, inventar)
 {
 }
Beispiel #6
0
 public City(int up, int down, int left, int right, List <string> image, int id, string name, string desc) : base(up, down, left, right, image, id, name, desc)
 {
     image = new List <string>();
     Stock = new Inventar();
     throw new Exception("No image" + "City");
 }