Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            AddCharacter addCharacter = new AddCharacter();

            addCharacter.FormClosing += AddWindow_FormClosing;
            addCharacter.Show();
        }
Esempio n. 2
0
 void OnEnable()
 {
     _target = target as AddCharacter;
     if (_target.Items == null)
     {
         _target.Items = new List <int>();
     }
     weaponCount = _target.Items.Count;
 }
Esempio n. 3
0
 private void AddWindow_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (sender is AddCharacter)
     {
         AddCharacter newChar = (AddCharacter)sender;
         if (newChar.Character != null)
         {
             session.AddCharacter(newChar.Character);
         }
     }
 }
Esempio n. 4
0
        public async Task <ServiceResponse <List <GetCharacter> > > AddCharacter(AddCharacter newcharacter)
        {
            ServiceResponse <List <GetCharacter> > serviceResponse = new ServiceResponse <List <GetCharacter> >();

            Character character = _mapper.Map <Character>(newcharacter);

            character.Id = characters.Max(c => c.Id) + 1;

            characters.Add(character);

            serviceResponse.Data = (characters.Select(c => _mapper.Map <GetCharacter>(c))).ToList();

            return(serviceResponse);
        }
Esempio n. 5
0
        public void AddNewCharacter(Player newPlayer)
        {
            var ac = new AddCharacter();

            ac.AddNewCharacter(newPlayer);
        }
 private void btn_Add_Click(object sender, EventArgs e)
 {
     AddCharacter?.Invoke(tb_Name.Text);
 }
Esempio n. 7
0
 public async Task <IActionResult> AddCharacter(AddCharacter newcharacter)
 {
     return(Ok(await _characterService.AddCharacter(newcharacter)));
 }