public void AddInitiative(string name, int initiative) { var entry = _initiative_repository.GetAll().FirstOrDefault(c => c.Name == name); if (entry == null) { _initiative_repository.Add(new InitiativeEntry { Name = name, Initiative = initiative }); } else { entry.Initiative = initiative; _initiative_repository.Update(entry); } _initiative_repository.Save(); InitiativeUpdated?.Invoke(); }
private void HandleInitiativeUpdated() { InitiativeUpdated?.Invoke(); _view.Close(); }