Esempio n. 1
0
        private void StartMatch(Discipline discipline)
        {
            _output = new Output();

            var description = new MatchDescription
            {
                Players =
                {
                    new PlayerDescription
                    {
                        Color  = Settings.Instance.PlayerColor,
                        Output = _output,
                        Name   = Settings.Instance.PlayerName,
                    },
                },

                Random           = new Random(),
                Output           = _output,
                LocalPlayerIndex = 0,
            };

            _match = discipline.CreateMatch(description);
            _matchStartTimestamp = Stopwatch.GetTimestamp();
            _matchFrameCount     = 0;
        }
        private void StartMatch(int numberOfPlayers)
        {
            _numberOfPlayers = numberOfPlayers;
            _currentPlayer   = 0;

            var description = new MatchDescription
            {
                Players = Enumerable.Range(0, numberOfPlayers).Select(i =>
                                                                      new PlayerDescription
                {
                    Color  = PlayerColors.Values[(i * 5) % PlayerColors.Values.Count],
                    Output = new Output(),
                    Name   = "PLAYER" + (i + 1),
                }).ToList(),

                Random           = new Random(),
                Output           = new Output(),
                LocalPlayerIndex = 0,
            };

            _match = _discipline.CreateMatch(description);
            _matchStartTimestamp = Stopwatch.GetTimestamp();
            _matchFrameCount     = 0;
        }