public void Setup()
        {
            gameMap              = GameMapUTests.CreateTestGameMap();
            player1              = PlayerUTests.CreateTestPlayer(1);
            player2              = PlayerUTests.CreateTestPlayer(2);
            player1Camera        = MapCameraUTests.CreateTestMapCamera();
            player2Camera        = MapCameraUTests.CreateTestMapCamera();
            player1.gameMap      = gameMap;
            player2.gameMap      = gameMap;
            player1.playerCamera = player1Camera;
            player2.playerCamera = player2Camera;

            actionMap       = player1.actionMap;
            unit1           = UnitCardUnitITests.CreateTestUnitWithCard();
            unit2           = UnitCardUnitITests.CreateTestUnitWithCard();
            unit1.player    = player1;
            unit2.player    = player2;
            hexCoords       = new Vector3Int(0, 0, 0);
            targetHexCoords = new Vector3Int(1, -1, 0);
            mousePosition   = gameMap.HexToWorldCoords(hexCoords);
            player1Camera.MoveCameraToPosition(mousePosition);
            player2Camera.MoveCameraToPosition(mousePosition);
            gameMap.AddPiece(unit1, hexCoords);

            // Get center hex
            gameHex = gameMap.GetWorldPositionHex(Vector3Int.zero);
        }
        public void DoesNotAttackPieceOfSamePlayer()
        {
            player1.PlayerLeftClicksAtWorldPosition(mousePosition);
            Unit unit3 = UnitCardUnitITests.CreateTestUnitWithCard();

            unit3.player = player1;
            gameMap.AddPiece(unit3, targetHexCoords);
            player1.PlayerRightClicksAtWorldPosition(gameMap.HexToWorldCoords(targetHexCoords));
            Assert.AreEqual(5, unit3.currentHealth);
        }
Beispiel #3
0
        public void Setup()
        {
            gameMap        = GameMapUTests.CreateTestGameMap();
            player         = PlayerUTests.CreateTestPlayer();
            player.gameMap = gameMap;
            unit           = UnitCardUnitITests.CreateTestUnitWithCard();
            unit.player    = player;
            hexCoords      = new Vector3Int(0, 0, 0);
            gameMap.AddPiece(unit, hexCoords);

            // Get center hex and set selected piece
            gameHex = gameMap.GetWorldPositionHex(Vector3Int.zero);
            player.SetSelectedPiece(gameHex.piece);
        }
 public void Setup()
 {
     gameMap         = GameMapUTests.CreateTestGameMap();
     actionMap       = ActionMapUTests.CreateTestActionMap();
     unit1           = UnitCardUnitITests.CreateTestUnitWithCard();
     unit2           = UnitCardUnitITests.CreateTestUnitWithCard();
     player1         = PlayerUTests.CreateTestPlayer(1);
     player2         = PlayerUTests.CreateTestPlayer(2);
     player1.gameMap = gameMap;
     player2.gameMap = gameMap;
     unit1.player    = player1;
     unit2.player    = player2;
     hexCoords       = Vector3Int.zero;
     gameMap.AddPiece(unit1, hexCoords);
 }
 public void Setup()
 {
     unit1        = UnitCardUnitITests.CreateTestUnitWithCard();
     player1      = PlayerUTests.CreateTestPlayer(1);
     unit1.player = player1;
 }
 public void Setup()
 {
     gameHex  = GameHexUTests.CreateTestGameHex();
     unit     = UnitCardUnitITests.CreateTestUnitWithCard();
     building = BuildingCardBuildingITests.CreateTestBuildingWithCard();
 }