public void AddCharacter(ICharacter character, PartySlot slot) { var relevantList = slot == PartySlot.FrontRow ? FrontRow : slot == PartySlot.BackSeat ? BackSeat : Reserve; var limit = slot == PartySlot.FrontRow ? FrontRowLimit : slot == PartySlot.BackSeat ? BackSeatLimit : -1; if (relevantList.Count == limit) { ExitHelper.Exit( slot == PartySlot.FrontRow ? ErrorCodes.ErrorCharLimitReachedFrontrow : slot == PartySlot.BackSeat ? ErrorCodes.ErrorCharLimitReachedBackseat : ErrorCodes.ErrorCharLimitReachedReserve, "Attempted to add Character to party depsite being full"); } relevantList.Add(character); _charMap[character] = relevantList; var currentHighestPartyCount = _model.Statistics[Statistic.HighestPartyCount]; var currentPartyCount = (ulong)_charMap.Count; if (currentPartyCount > currentHighestPartyCount) { _model.Statistics.AddToStatistic(Statistic.HighestPartyCount, (uint)(currentPartyCount - currentHighestPartyCount)); } character.LvlUp(Experience); ResetCache(); }
public void Notify() { if (RConsole.ConsoleWindowClosed) { ExitHelper.Exit(0, "Window was closed"); } Show(); }
public ISpell GetSpell(string name) { name = name.ToLower(); if (!_nameMap.ContainsKey(name)) { ExitHelper.Exit(ErrorCodes.ErrorSpellNotFound, "Spell not found " + name); } return(_nameMap[name]); }
public IAffliction GetAffliction(string name) { name = name.ToLower(); if (!_afflictions.ContainsKey(name)) { ExitHelper.Exit(ErrorCodes.ErrorAfflictionNotFound, "Affliction not found " + name); } return(_afflictions[name]); }
private void CancelAction() { if (FirstStateActive()) { ExitHelper.Exit(); } else { Previous(); } }
public override void Run() { Model.CommitChanges(); Input.Update(); if (Input.Action(Actions.Cancel)) { ExitHelper.Exit(); } else if (Input.Action(Actions.Confirm)) { Master.Next(); } Model.CommitChanges(); }