public void Setup()
 {
     player              = PlayerUTests.CreateTestPlayer();
     cardUnitDisplay     = CardUnit_CardUnitDisplayITests.CreateTestCardUnitDisplay();
     cardBuildingDisplay = CardBuilding_CardBuildingDisplayITests.CreateTestCardBuildingDisplay();
     cardResourceDisplay = CardResource_CardResourceDisplayITests.CreateTestCardResourceDisplay();
 }
Пример #2
0
 public void Setup()
 {
     player       = PlayerUTests.CreateTestPlayer();
     cardUnit     = CardUnitUTests.CreateTestCardUnit();
     cardBuilding = CardBuildingUTests.CreateTestCardBuilding();
     cardResource = CardResourceUTests.CreateTestFoodCardResource();
 }
        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);
        }
Пример #4
0
 public void Setup()
 {
     player    = PlayerUTests.CreateTestPlayer();
     cardUnit1 = CardUnitUTests.CreateTestCardUnit();
     cardUnit2 = CardUnitUTests.CreateTestCardUnit();
     player.DrawCard(cardUnit1);
     cardUnitDisplay1 = player.cardPieceDisplays[0];
     Sprite[] cardBackgrounds = Resources.LoadAll <Sprite>("Art/Cards/Card Backgrounds");
     playableBorder    = cardBackgrounds[1];
     unplayableBorder  = Resources.Load <Sprite>(ENV.CARD_UNPLAYABLE_BORDER_RESOURCE_PATH);
     highlightedBorder = Resources.Load <Sprite>(ENV.CARD_HIGHLIGHTED_BORDER_RESOURCE_PATH);
 }
Пример #5
0
        public void AttacksPieceWithinRange()
        {
            Player player2 = PlayerUTests.CreateTestPlayer(2);

            unit2.player = player2;
            Vector3Int targetHexCoords = gameMap.WorldToHexCoords(new Vector3(1, 0.55f));

            gameMap.AddPiece(unit2, targetHexCoords);
            unit1.might = 3;
            gameMap.AttackPiece(player.GetSelectedPiece(), unit2);
            Assert.AreEqual(2, unit2.currentHealth);
        }
Пример #6
0
        public void DoesNotMovePieceToHexWithPiece()
        {
            Player player2 = PlayerUTests.CreateTestPlayer(2);

            unit2.player = player2;
            Vector3Int targetHexCoords = gameMap.WorldToHexCoords(new Vector3(1, 0.55f));

            gameMap.AddPiece(unit2, targetHexCoords);
            gameMap.MovePiece(player.GetSelectedUnit(), targetHexCoords);
            Assert.AreEqual(unit1, gameHex.piece);
            Assert.AreEqual(unit2, gameMap.GetHexAtHexCoords(targetHexCoords).piece);
        }
Пример #7
0
        public void DoesNotAttackPieceOutsideRange()
        {
            Player player2 = PlayerUTests.CreateTestPlayer(2);

            unit2.player = player2;
            Vector3Int targetHexCoords = gameMap.WorldToHexCoords(new Vector3(3, 1.65f));

            gameMap.AddPiece(unit2, targetHexCoords);
            unit1.might = 3;
            unit1.range = 1;
            gameMap.AttackPiece(player.GetSelectedPiece(), unit2);
            Assert.AreEqual(5, unit2.currentHealth);
        }
Пример #8
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()
 {
     player           = PlayerUTests.CreateTestPlayer();
     foodResourceCard = CardResourceUTests.CreateTestFoodCardResource();
 }