예제 #1
0
 public FinalCreator(FinalRound final, Settings settings)
 {
     InitializeComponent();
     _final           = final;
     _settings        = settings;
     _questionButtons = new List <Button>();
     DrawQuestionGrid();
 }
예제 #2
0
 private void Rekey(byte[] key)
 {
     _KeySchedule       = new KeySchedule(key, BlockSize / Constants.BitsPerByte);
     _Settings          = new Settings(key.Length * Constants.BitsPerByte, BlockSize);
     _InitialRound      = new InitialRound(_Settings, _KeySchedule);
     _IntermediateRound = new IntermediateRound(_Settings, _KeySchedule);
     _FinalRound        = new FinalRound(_Settings, _KeySchedule);
 }
        public void Test_who_Win()
        {
            FinalRound final    = new FinalRound();
            Teem       teem     = new Teem();
            var        teemList = database.makeTeam_QueryBy_Continnent(area.GetContinentCode(Continent.Asia));
            var        whowin   = final.startFinal(teemList[0], teemList[1]);

            Assert.AreEqual(teem.GetType(), whowin.GetType());
        }
        private void MainGrid_Loaded(object sender, RoutedEventArgs e)
        {
            worldCup = new WorldCup();
            worldCup.TeamProvider = new FootballLib.DataProviders.SqlProvider();
            PreRound   preRound   = new PreRound();
            PlayOff    playOff    = new PlayOff();
            OctRound   octRound   = new OctRound();
            QuadRound  quadRound  = new QuadRound();
            FinalRound finalRound = new FinalRound();

            preRound.InputTeams = worldCup.TeamList;

            playOff.InputTeams = preRound.Play();
            resultPlayOff      = playOff.Play();
            matchesPlayOff     = playOff.MatchList;

            octRound.InputTeams = new List <Team>(resultPlayOff);
            resultOct           = octRound.Play();
            matchesOct          = octRound.MatchList;

            quadRound.InputTeams = new List <Team>(resultOct);
            resultQuad           = quadRound.Play();
            matchesQuad          = quadRound.MatchList;

            finalRound.InputTeams = new List <Team>(resultQuad);
            Team championship = finalRound.Play()[0];

            matchesFinal = finalRound.MatchList;

            groupA.OnClick += Group_OnClick;
            groupB.OnClick += Group_OnClick;
            groupC.OnClick += Group_OnClick;
            groupD.OnClick += Group_OnClick;
            groupE.OnClick += Group_OnClick;
            groupF.OnClick += Group_OnClick;
            groupG.OnClick += Group_OnClick;
            groupH.OnClick += Group_OnClick;

            sc1.OnClick += Sc_Playoff;
            sc2.OnClick += Sc_Playoff;
            sc3.OnClick += Sc_Playoff;
            sc4.OnClick += Sc_Playoff;
            sc5.OnClick += Sc_Playoff;
            sc6.OnClick += Sc_Playoff;
            sc7.OnClick += Sc_Playoff;
            sc8.OnClick += Sc_Playoff;

            groupQuad1.OnClick += GroupQuad_OnClick;
            groupQuad2.OnClick += GroupQuad_OnClick;
            groupQuad3.OnClick += GroupQuad_OnClick;
            groupQuad4.OnClick += GroupQuad_OnClick;

            scQ1.OnClick += ScQ_OnClick;
            scQ2.OnClick += ScQ_OnClick;
            scQ3.OnClick += ScQ_OnClick;
            scQ4.OnClick += ScQ_OnClick;
        }
예제 #5
0
 public FinalRoundWindow(Server server, FinalRound final, Settings settings, Dictionary <string, Player> players)
 {
     InitializeComponent();
     _server = server;
     _server.SetMessageManager(new Action <string, string>(ManageBet));
     _final           = final;
     _settings        = settings;
     _players         = players;
     _bets            = new Dictionary <string, int>();
     _canStart        = false;
     _questionButtons = new List <Button>();
     DrawQuestionGrid();
     _server.BroadcastMessage(MessageSigns.FinalRoundMessage);
 }
        public void Test_WinningTeemHasSorce_ISNevgative()
        {
            FinalRound final    = new FinalRound();
            Teem       teem     = new Teem();
            var        teemList = database.makeTeam_QueryBy_Continnent(area.GetContinentCode(Continent.Asia));
            var        whowin   = final.startFinal(teemList[0], teemList[1]);

            if (whowin.TeemTotalSroce < 0)
            {
                Assert.IsTrue(false);
            }
            else
            {
                Assert.IsTrue(true);
            }
        }
예제 #7
0
        private void Init(IProvider provider)
        {
            worldCup = new Worldcup();
            worldCup.TeamProvider = provider;

            preRound   = new PreRound();
            playOff    = new PlayOff();
            octRound   = new OctRound();
            quadRound  = new QuadRound();
            finalRound = new FinalRound();

            preRound.InputTeams   = worldCup.TeamList;
            playOff.InputTeams    = preRound.Play();
            octRound.InputTeams   = playOff.Play();
            quadRound.InputTeams  = octRound.Play();
            finalRound.InputTeams = quadRound.Play();
        }
        public void Test_WinningTeemHasDistrubutedTheirSorcetoPlayer()
        {
            FinalRound final       = new FinalRound();
            Teem       teem        = new Teem();
            var        teemList    = database.makeTeam_QueryBy_Continnent(area.GetContinentCode(Continent.Asia));
            var        whowin      = final.startFinal(teemList[0], teemList[1]);
            int        WinnerSorce = whowin.SrocePerRound;
            int        TotalDitrubtedPlayerSorce = 0;

            foreach (var item in whowin.listOfPlayer)
            {
                if (item._Pesonalsroce != 0)
                {
                    TotalDitrubtedPlayerSorce += item._Pesonalsroce;
                    //Console.WriteLine(item._Pesonalsroce);
                }
            }
            Console.WriteLine($"Teem Has a Sroce of {whowin.SrocePerRound}  And has Distribute Sroce to Their Goal Player");
            Assert.AreEqual(whowin.SrocePerRound, TotalDitrubtedPlayerSorce);
        }
예제 #9
0
        public void Play(out Team Winner)
        {
            Start?.Invoke();
            Jingle?.Invoke("/Opening.mp3");
            RequestIn("Готовы к следующему раунду?");

            foreach (Round round in Rounds)
            {
                CurrentRound = round;
                RequestOut($"== {round.Name} ==");
                Jingle?.Invoke(round.Jingle);
                RefreshBoard?.Invoke();

                int score = round.Play(out Winner);
                Winner.Score += score;
                SetScore();

                RequestOut("-- Открываем табло --");
                round.Reveal();
                RequestIn("Готовы к следующему раунду?");
            }

            CurrentRound = FinalRound;
            RequestOut($"== {FinalRound.Name} ==");
            Jingle?.Invoke(FinalRound.Jingle);
            ShowTitle();
            FinalRound.Play(out Winner);

            Winner = Teams.OrderByDescending(team => team.Score)
                     .Take(1)
                     .Single();

            Jingle?.Invoke("/Closing.mp3");
            RequestIn("Нажмите для завершения игры");
            ShowTitle();
            TheEnd?.Invoke();
        }
예제 #10
0
 public Game Add(FinalRound Round)
 {
     FinalRound      = Round;
     FinalRound.Game = this;
     return(this);
 }