Exemplo n.º 1
0
    public static void Main()
    {
        WeaponInventory inventory = new WeaponInventory();

        string input;

        while ((input = Console.ReadLine()) != "END")
        {
            var commandTokens = input.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            var command = commandTokens[0];
            switch (command)
            {
            case "Create":
                inventory.Create(commandTokens[1], commandTokens[2]);
                break;

            case "Add":
                inventory.Add(commandTokens[1], int.Parse(commandTokens[2]), commandTokens[3]);
                break;

            case "Remove":
                inventory.Remove(commandTokens[1], int.Parse(commandTokens[2]));
                break;

            case "Print":
                inventory.Print(commandTokens[1]);
                break;
            }
        }
    }
Exemplo n.º 2
0
 public Market()
 {
     ArmorInventory.Add(gambesonLight);
     ArmorInventory.Add(gambesonThick);
     ArmorInventory.Add(chainmail);
     ArmorInventory.Add(platemail);
     WeaponInventory.Add(dagger);
     WeaponInventory.Add(sword);
     WeaponInventory.Add(spear);
     WeaponInventory.Add(battleAxe);
 }
Exemplo n.º 3
0
        public override void GenerateWeapon()
        {
            Weapon BanditWeapon = new Weapon();

            BanditWeapon.Name   = BanditWeapon.GenerateName();
            BanditWeapon.Attack = BanditWeapon.GenerateValue(BanditWeapon.Name);
            BanditWeapon.Stats  = BanditWeapon.GenerateStatBonus(BanditWeapon.Name);
            BanditWeapon.Price  = BanditWeapon.GeneratePrice(BanditWeapon.Attack, BanditWeapon.Stats.StatBonus);
            WeaponInventory.Add(BanditWeapon);
            WeaponEquipped.Add(BanditWeapon);
            ApplyEquipedWeapon();
        }
Exemplo n.º 4
0
    public void EquipPrimary(Item newItem)
    {
        {
            int slotIndex = (int)newItem.itemtype;


            Item oldItem = null;

            if (currentEquipment[slotIndex] != null)
            {
                oldItem = currentEquipment[slotIndex];
                weaponInventory.Add(oldItem);
            }

            if (onEquipmentChanged != null)
            {
                onEquipmentChanged.Invoke(newItem, oldItem);
            }

            Debug.Log("slotIndex" + slotIndex);
            currentEquipment[slotIndex] = newItem;
            primaryWeaponInventory.Add(newItem);
        }
    }
Exemplo n.º 5
0
Arquivo: Body.cs Projeto: Laboost/TRPG
 public void AddToWeaponInventory(Item item) //adds item to player's inventory
 {
     WeaponInventory.Add(item);
 }
Exemplo n.º 6
0
 public void GenerateSaleList()
 {
     ArmorInventory.Add(GenerateArmor());
     WeaponInventory.Add(GenerateWeapon());
 }