コード例 #1
0
        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();
        }
コード例 #2
0
 private void HandleInitiativeUpdated()
 {
     InitiativeUpdated?.Invoke();
     _view.Close();
 }