public static int Advisory(Team team, IEnumerable <Team> teams) { var max = teams.Max (_ => _.AdvisoryScores); if (max == 0) return 0; return (100 * team.AdvisoryScores) / max; }
public static int Task(Team team, IEnumerable <Team> teams) { var max = teams.Max (_ => _.TaskScores); if (max == 0) return 0; return (100 * team.TaskScores) / max; }
public static int Rating(Team team, IEnumerable <Team> teams) { var max = teams.Max (_ => Attack (_, teams) + Defence (_, teams) + Advisory (_, teams) + Task (_, teams)); if (max == 0) return 0; return ((Attack (team, teams) + Defence (team, teams) + Advisory (team, teams) + Task (team, teams)) * 100) / max; }
public static int Defence(Team team, IEnumerable <Team> teams) { var max = teams.Max (_ => _.DefenceScores); if (max == 0) return 0; return (100 * team.DefenceScores) / max; }
internal void ApplyScores(Team team, IEnumerable <Team> all) { if (team.TeamControl != this) return; this.total_scores.Value = TeamRating.Rating (team, all); this.attack_scores.Value = TeamRating.Attack (team, all); this.defence_scores.Value = TeamRating.Defence (team, all); this.advisory_scores.Value = TeamRating.Advisory (team, all); this.tasks_scores.Value = TeamRating.Task (team, all); }
public void Add(Team attacker, Service victim, int force) { var action = new Attack (attacker, victim.Owner, victim, force); var id = this.attack_id++; var animation = this.PrepareAnimation (action, id); if (animation == null) return; lock (this.lock_obj) { this.animations.Add (id, animation); animation.Storyboard.Begin (); } }