public void SetEfficiencyScore(IBattleAttribute battle, IWrittenByAttribute writtenBy, double efficiencyScore) { if (HasBattle(battle)) { IBattleOutcome battleOutcome = GetBattleOutcome(battle); //battleOutcome.SetEfficiencyScore(writtenBy, efficiencyScore); } }
public IBattleOutcome CurrentBattle() { List <IBattleOutcome> battleOutcomes = GetAllBattleOutcomes(); DateTime max = battleOutcomes.Max((battle) => battle.Battle.Deadline); IBattleOutcome current = battleOutcomes.Where((battle) => battle.Battle.Deadline == max).FirstOrDefault(); //IBattleOutcome current = battleOutcomes.Where((battle) => battle.Battle.Name == "Census Maximus").FirstOrDefault(); return(current); }
public void CreateBattle(IBattleAttribute battle, ISenseiAttribute sensei) { if (!HasBattle(battle)) { IBattleOutcome battleOutcome = Factory.Get <IBattleOutcome>(); battleOutcome.Battle = battle; battleOutcome.Sensei = sensei; battles.Add(battleOutcome); } }
public void AssignAwardToPlayer(IWrittenByAttribute player, IBattleAttribute battle, IBonusPointsAttribute award) { if (HasBattle(battle)) { IBattleOutcome battleOutcome = GetBattleOutcome(battle); battleOutcome.AddAward(player, award); } else { IBattleOutcome battleOutcome = Factory.Get <IBattleOutcome>(); battleOutcome.Battle = battle; battleOutcome.AddAward(player, award); battles.Add(battleOutcome); } }
public void GrantPointsToPlayer(IBattleAttribute battle, IWrittenByAttribute writtenBy, int points = 1) { if (HasBattle(battle)) { IBattleOutcome battleOutcome = GetBattleOutcome(battle); battleOutcome.AddPoint(writtenBy, points); } else { IBattleOutcome battleResults = Factory.Get <IBattleOutcome>(); battleResults.Battle = battle; battleResults.AddPoint(writtenBy, points); battles.Add(battleResults); } }
public int CompareTo(IBattleOutcome other) { DateTime thisDeadline = Battle.Deadline; DateTime otherDeadline = other.Battle.Deadline; int result = 0; if (thisDeadline > otherDeadline) { result = -1; } else if (thisDeadline < otherDeadline) { result = 1; } return(result); }
public IBattleOutcome GetBattleOutcome(IBattleAttribute battle) { IBattleOutcome results = battles.Where((x) => x.Battle.Equals(battle))?.FirstOrDefault(); return(results); }
public HttpResponseMessage Get() { IBattleOutcome battle = battleRepository.CurrentBattle(); return(Request.CreateResponse(HttpStatusCode.OK, battle)); }
public IBattleOutcome GetMostRecentBattle() { IBattleOutcome battle = battleRepository.CurrentBattle(); return(battle); }