private void button1_Click(object sender, EventArgs e) { AddCharacter addCharacter = new AddCharacter(); addCharacter.FormClosing += AddWindow_FormClosing; addCharacter.Show(); }
void OnEnable() { _target = target as AddCharacter; if (_target.Items == null) { _target.Items = new List <int>(); } weaponCount = _target.Items.Count; }
private void AddWindow_FormClosing(object sender, FormClosingEventArgs e) { if (sender is AddCharacter) { AddCharacter newChar = (AddCharacter)sender; if (newChar.Character != null) { session.AddCharacter(newChar.Character); } } }
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); }
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); }
public async Task <IActionResult> AddCharacter(AddCharacter newcharacter) { return(Ok(await _characterService.AddCharacter(newcharacter))); }