コード例 #1
0
ファイル: Program.cs プロジェクト: SoftBishop/fixach
 public void addPair(PairParticipant pair)
 {
     pairs.Add(pair);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: SoftBishop/fixach
        static void Main(string[] args)
        {
            Participant man1 = new Participant("Vanya", "kozlov", true);
            Participant woman1 = new Participant("girl", "kozlova", false);
            PairParticipant pair1 = new PairParticipant("krevedko", man1, woman1);

            Participant man2 = new Participant("Pupkov", "Vasya", true);
            Participant woman2 = new Participant("Tyan", "New", false);
            PairParticipant pair2 = new PairParticipant("2ch.hk/b", man2, woman2);

            Judge judge1 = new Judge("666", "228", true);
            Judge judge2 = new Judge("Body", "Positive", false);

            Сompetition kvalificationCompet = new Сompetition("квалификация", 6, 0.2);
            Сompetition shortCompet = new Сompetition("короткая", 6, 0.3);
            Сompetition freeCompet = new Сompetition("произвольная программа", 6, 0.5);

            Сhampionship championship = new Сhampionship();

            championship.addCompetition(kvalificationCompet);
            championship.addCompetition(shortCompet);
            championship.addCompetition(freeCompet);

            JudgeProtocol protocol1 = new JudgeProtocol(judge1, pair1, kvalificationCompet, 3);
            JudgeProtocol protocol2 = new JudgeProtocol(judge1, pair1, shortCompet, 1);
            JudgeProtocol protocol3 = new JudgeProtocol(judge1, pair1, freeCompet, 4);

            JudgeProtocol protocol4 = new JudgeProtocol(judge1, pair2, kvalificationCompet, 1);
            JudgeProtocol protocol5 = new JudgeProtocol(judge1, pair2, shortCompet, 1);
            JudgeProtocol protocol6 = new JudgeProtocol(judge1, pair2, freeCompet, 1);

            JudgeProtocol protocol7 = new JudgeProtocol(judge2, pair1, kvalificationCompet, 1);
            JudgeProtocol protocol8 = new JudgeProtocol(judge2, pair1, shortCompet, 1);
            JudgeProtocol protocol9 = new JudgeProtocol(judge2, pair1, freeCompet, 1);

            JudgeProtocol protocol10 = new JudgeProtocol(judge2, pair2, kvalificationCompet, 3);
            JudgeProtocol protocol11 = new JudgeProtocol(judge2, pair2, shortCompet, 3);
            JudgeProtocol protocol12 = new JudgeProtocol(judge2, pair2, freeCompet, 3);

            championship.addProtocol(protocol1);
            championship.addProtocol(protocol2);
            championship.addProtocol(protocol3);
            championship.addProtocol(protocol4);
            championship.addProtocol(protocol5);
            championship.addProtocol(protocol6);
            championship.addProtocol(protocol7);
            championship.addProtocol(protocol8);
            championship.addProtocol(protocol9);
            championship.addProtocol(protocol10);
            championship.addProtocol(protocol11);
            championship.addProtocol(protocol12);

            championship.displayWinner();
            System.Console.ReadLine();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: SoftBishop/fixach
        public JudgeProtocol(Judge judge, PairParticipant pair, Сompetition competition, int score)
        {
            this.judge = judge;
            this.pair = pair;
            this.competition = competition;

            if (score > competition.score && score < 0)
                throw new Exception("Judge score must be less or equal competition score and must be greater 0");
            else
                this.score = score;
        }