コード例 #1
0
        public async Task <IActionResult> UpdateWeapon(int id, WeaponUpdateDto weaponUpdateDto)
        {
            var weapon = await _repo.GetWeapon(id);

            weapon.SoldierId = weaponUpdateDto.SoldierId;

            await _repo.UpdateWeapon(weapon);

            return(NoContent());
        }
コード例 #2
0
        public override void Execute()
        {
            string name   = Data[1];
            Weapon weapon = weaponRepository.GetWeapon(name);

            Console.WriteLine(weapon.ToString());
        }
コード例 #3
0
        public override void Execute()
        {
            string name   = Data[1];
            int    index  = int.Parse(Data[2]);
            Weapon weapon = weaponRepository.GetWeapon(name);

            weapon.RemoveGem(index);
        }
コード例 #4
0
        public override void ExecuteCommand()
        {
            var     weaponName = data[1];
            IWeapon weapon     = weaponRepository.GetWeapon(weaponName);
            int     socket     = int.Parse(data[2]);
            IGem    gem        = gemFactory.CreateGem(data);

            weapon.AddGem(gem, socket);
        }
コード例 #5
0
        public void AddNewEquipmentElement(string weaponName, string elementName, int elementDamange)
        {
            WeaponDTO tempWeapon = _weaponRepo.GetWeapon(weaponName);

            //find element to see if exists in element table
            //_elementRepo

            //_elementService.CheckElementName(elementName);
            throw new NotImplementedException();
        }
コード例 #6
0
        public override void Execute()
        {
            string weaponName = Data[1];
            int    index      = int.Parse(Data[2]);

            string[] gemInfo = Data[3].Split();
            Gem      gem     = gemFactory.CreateGem(gemInfo);
            Weapon   weapon  = weaponRepository.GetWeapon(weaponName);

            weapon.AddGem(index, gem);
        }
コード例 #7
0
 public WeaponDTO GetWeapon(string weaponName)
 {
     //check string
     return(_weaponRepo.GetWeapon(weaponName));
 }