Exemple #1
0
        //Инициализация игры
        public void Create(BaseData data)
        {
            if (!(data is GameControllerData))
            {
                throw new ArgumentException();
            }

            HomeManager.Create(new TeamControllerData((data as GameControllerData).HomeTeamName));
            GuestManager.Create(new TeamControllerData((data as GameControllerData).GuestTeamName));

            GameOverEvent += OnGameOverEvent;
            GameEvent     += OnGameEvent;
            Game           = new Game(HomeManager.Team, GuestManager.Team);
            matchTime      = 90;
            timeGone       = 0;
            additionalTime = 2;
            timer          = new Timers.Timer(500);
            timer.Elapsed += TimerCallback;
            timer.Start();
        }