Пример #1
0
        public void CreatesHexStaticFunction()
        {
            // Create normal hex
            Hex hex = Hex.CreateHex <Hex>(TileUTests.CreateTestTileData(), Vector3Int.zero);

            Assert.IsNotNull(hex);
            Assert.AreEqual(Vector3Int.zero, hex.hexCoords);
            Assert.AreEqual(Vector3Int.zero, hex.tileCoords);

            // Create game hex
            GameHex gameHex = (GameHex)Hex.CreateHex <GameHex>(TileUTests.CreateTestTileData(), Vector3Int.zero);

            Assert.IsNotNull(gameHex);
            Assert.AreEqual(Vector3Int.zero, gameHex.hexCoords);
            Assert.AreEqual(Vector3Int.zero, gameHex.tileCoords);
        }
Пример #2
0
        public void CreatesHexStaticFunctionForNonCenterTiles()
        {
            // Create normal hex
            Vector3Int hexCoords  = new Vector3Int(1, -1, 0);
            Vector3Int tileCoords = new Vector3Int(0, 1, 0);
            Hex        hex        = Hex.CreateHex <Hex>(TileUTests.CreateTestTileData(), hexCoords);

            Assert.IsNotNull(hex);
            Assert.AreEqual(hexCoords, hex.hexCoords);
            Assert.AreEqual(tileCoords, hex.tileCoords);

            // Create game hex
            GameHex gameHex = (GameHex)Hex.CreateHex <GameHex>(TileUTests.CreateTestTileData(), hexCoords);

            Assert.IsNotNull(gameHex);
            Assert.AreEqual(hexCoords, gameHex.hexCoords);
            Assert.AreEqual(tileCoords, gameHex.tileCoords);
        }
        // Creates new game hex
        public static GameHex CreateTestGameHex()
        {
            GameHex newGameHex = new GameHex(TileUTests.CreateTestTileData(), Vector3Int.zero);

            return(newGameHex);
        }
Пример #4
0
        // Create new test hex
        public static Hex CreateTestHex()
        {
            Hex newHex = new Hex(TileUTests.CreateTestTileData(), Vector3Int.zero);

            return(newHex);
        }