コード例 #1
0
        public void Initialize()
        {
            _testGameMoveDataPoint = new GameMoveDataPoint { MoveType = MoveType.Dump, Player = "NewPlayer", TimeOfMove = 5 };

            _playerGameStats = new PlayerGameStats
                {
                    AvgTimeBetweenDumps = 10,
                    AvgTimeBetweenPeels = 5,
                    IsWinner = true,
                    NumberOfDumps = 3,
                    NumberOfPeels = 0,
                    PerformedFirstPeel = false,
                    RawGameData = new List<GameMoveDataPoint>() {_testGameMoveDataPoint, _testGameMoveDataPoint, _testGameMoveDataPoint}
                };

            _gameData = new GameData {GameDuration = 10, GameHost = "GameHost", GameStartTime = DateTime.Now, Winner = "NewPlayer"};
            _gameData.GameMoves.Add(_testGameMoveDataPoint);
            _gameData.GameMoves.Add(_testGameMoveDataPoint);
            _gameData.PlayerDictionary.Add("NewPlayer", _playerGameStats);
            _gameData.PlayerDictionary.Add("NewPlayer2", _playerGameStats);

            _gameDataList = new GameDataList();
            _gameDataList._GameData.Add(_gameData);
            _gameDataList._GameData.Add(_gameData);

            _stringPacketV1 = new PacketV1
                {
                    PacketType = PacketType.c_QueryIfAliasAvailable,
                    Data = "Mobius",
                    Recipients = null,
                    Sender = "*****@*****.**"
                };

            _IBinarySerializablePacketV1 = new PacketV1
            {
                PacketType = PacketType.c_UploadGameData,
                Data = _gameData,
                Recipients = null,
                Sender = "*****@*****.**"
            };

            _packetBase = new PacketBase
                {
                    PacketVersion = PacketVersion.Version1,
                    Data = _stringPacketV1
                };
        }
コード例 #2
0
ファイル: GameData.cs プロジェクト: jonathanyeung/ozwego
        /// <summary>
        /// Save a game move data point to the game data.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="timeOfMove"></param>
        /// <param name="moveType"></param>
        public void AddGameMoveDataPoint(string player, int timeOfMove, MoveType moveType)
        {
            var dataPoint = new GameMoveDataPoint(player, timeOfMove, moveType);

            GameMoves.Add(dataPoint);
        }
コード例 #3
0
        /// <summary>
        /// Save a game move data point to the game data.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="timeOfMove"></param>
        /// <param name="moveType"></param>
        public void AddGameMoveDataPoint(string player, int timeOfMove, MoveType moveType)
        {
            var dataPoint = new GameMoveDataPoint(player, timeOfMove, moveType);

            GameMoves.Add(dataPoint);
        }