public void ProcessPlacePieceRequestOnTaskField() { InitGameMaster(); var player = GetPlayer("testGUID-0001", 10, TeamColour.red, ActionType.TestPiece); GameArea.GameObjects.Piece p = gameMaster.GetPieceById(0); p.Type = PieceType.normal; var messagePieceKnown = new Piece(p.Type, p.ID) { timestamp = DateTime.Now, }; EquipPlayerWithPiece(messagePieceKnown, player); player.SetLocation(1, 5); gameMaster.SetAbsolutePlayerLocation(1, 5, "testGUID-0001"); PlacePieceGM data = new PlacePieceGM("testGUID-0001", 0); string[] msg = data.Process(gameMaster); Assert.AreEqual(p.ID, gameMaster.GetBoard.GetTaskField(player.Location.X, player.Location.Y).Piece.ID); }
public void ProcessPlacePieceRequestOnGoal() { InitGameMaster(); var player = GetPlayer("testGUID-0001", 10, TeamColour.blue, ActionType.TestPiece); ulong goalsLeft = gameMaster.GoalsBlueLeft; GameArea.GameObjects.Piece p = gameMaster.GetPieceById(0); p.Type = PieceType.normal; var messagePieceKnown = new Piece(p.Type, p.ID) { timestamp = DateTime.Now, }; EquipPlayerWithPiece(messagePieceKnown, player); player.SetLocation(1, 1); gameMaster.SetAbsolutePlayerLocation(1, 1, "testGUID-0001"); gameMaster.GetBoard.GetGoalField(1, 1).Type = GoalFieldType.goal; PlacePieceGM data = new PlacePieceGM("testGUID-0001", 0); string[] msg = data.Process(gameMaster); Assert.AreEqual(goalsLeft - 1, gameMaster.GoalsBlueLeft); }