public async Task <RuntimeResult> SetStatisticFlagAsync(Statistic stat, Globals.StatisticFlag flag) { stat.StatisticFlag = flag; await _statService.SaveStatisticAsync(stat); return(GenericResult.FromSuccess("Flag set successfully.")); }
/// <summary> /// Returns the value of the specified character's statistic matching the given Statistic Flag. /// </summary> /// <returns>Returns 0 if a matching statistic flag is not found.</returns> public int GetStatistic(IList <StatisticValue> statSheet, Globals.StatisticFlag flag) { var match = statSheet.FirstOrDefault(x => x.Statistic.StatisticFlag.Equals(flag)); if (match == null) { return(0); } return(match.Value); }
/// <summary> /// Returns the value of the specified character's statistic matching the given Statistic Flag. /// </summary> /// <returns>Returns 0 if a matching statistic flag is not found.</returns> public int GetStatistic(Character character, Globals.StatisticFlag flag) => GetStatistic(character?.Statistics, flag);