Ejemplo n.º 1
0
        public static int Advisory(Team team, IEnumerable <Team> teams)
        {
            var max = teams.Max (_ => _.AdvisoryScores);
            if (max == 0)
                return 0;

            return (100 * team.AdvisoryScores) / max;
        }
Ejemplo n.º 2
0
        public static int Task(Team team, IEnumerable <Team> teams)
        {
            var max = teams.Max (_ => _.TaskScores);
            if (max == 0)
                return 0;

            return (100 * team.TaskScores) / max;
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        public static int Defence(Team team, IEnumerable <Team> teams)
        {
            var max = teams.Max (_ => _.DefenceScores);
            if (max == 0)
                return 0;

            return (100 * team.DefenceScores) / max;
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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 ();
            }
        }