public void updatePerson(CPerson updated) { if (!this.persons.ContainsKey(updated.getID())) { throw new System.ArgumentException("Персонажа с таким ID не существует!"); } persons[updated.getID()] = updated; }
public EditPersonForm(ref CAimManager _aimManager, ref CItemManager _itemManager, ref CPersonManager _personManager) { InitializeComponent(); editedPerson = new CPerson(); aimManager = _aimManager; itemManager = _itemManager; personManager = _personManager; fillUIComponents(); }
public EditPersonForm(CPerson _person, ref CAimManager _aimManager, ref CItemManager _itemManager, ref CPersonManager _personManager) { InitializeComponent(); editedPerson = _person; aimManager = _aimManager; itemManager = _itemManager; personManager = _personManager; fillUIComponents(); fillPersonData(); }
public void refreshItemOnPersons(List <int> ownersID, int itemID) { foreach (int ownerID in ownersID) { CPerson person = getPerson(ownerID); if (!person.itemsId.Contains(itemID)) { persons[ownerID].itemsId.Add(itemID); } } foreach (CPerson person in persons.Values) { if (person.itemsId.Contains(itemID) && !ownersID.Contains(person.getID())) { person.itemsId.Remove(itemID); } } }
public void refreshAimOnPersons(List <int> followersID, int aimID) { foreach (int followerID in followersID) { CPerson person = getPerson(followerID); if (!person.aimsId.Contains(aimID)) { persons[followerID].aimsId.Add(aimID); } } foreach (CPerson person in persons.Values) { if (person.aimsId.Contains(aimID) && !followersID.Contains(person.getID())) { person.aimsId.Remove(aimID); } } }
public void addPerson(CPerson person) { int newID = calcNewID(); addPerson(newID, person.getName(), person.sex, person.description, person.unremovable, person.comment, person.itemsId, person.aimsId, person.clan, person.altName); }
private void ddlPersonChoose_SelectedValueChanged(object sender, EventArgs e) { chosenPerson = personManager.getPerson((int)ddlPersonChoose.SelectedValue); ddlSexChoose.SelectedValue = chosenPerson.sex; }
public void updatePerson(CPerson updated) { if (!this.persons.ContainsKey(updated.getID())) throw new System.ArgumentException("Персонажа с таким ID не существует!"); persons[updated.getID()] = updated; }