Exemplo n.º 1
0
        // Helper function that creates the correct type of tile
        Objects.Tile CreateTile(Vector3 vPos, eTileType type = eTileType.Default)
        {
            Objects.Tile Tile = null;
            switch (type)
            {
            case (eTileType.Default):
                Tile = new Objects.Tile(m_Game);
                break;

            case (eTileType.Green):
                Tile = new Objects.TileGreen(m_Game);
                break;

            case (eTileType.Base):
                Tile = new Objects.TileGreen(m_Game);
                break;

            case (eTileType.Red):
                Tile = new Objects.TileRed(m_Game);
                break;

            case (eTileType.EnemySpawn):
                Tile = new Objects.TileRed(m_Game);
                break;
            }

            if (Tile != null)
            {
                Tile.Position = vPos;
                GameState.Get().SpawnGameObject(Tile);
                m_Tiles.AddLast(Tile);
            }

            return(Tile);
        }
Exemplo n.º 2
0
        // Helper function that creates the correct type of tile
        Objects.Tile CreateTile(Vector3 vPos, eTileType type = eTileType.Default)
        {
            Objects.Tile Tile = null;
            switch (type)
            {
                case (eTileType.Default):
                    Tile = new Objects.Tile(m_Game);
                    break;
                case (eTileType.Green):
                    Tile = new Objects.TileGreen(m_Game);
                    break;
                case (eTileType.Base):
                    Tile = new Objects.TileGreen(m_Game);
                    break;
                case (eTileType.Red):
                    Tile = new Objects.TileRed(m_Game);
                    break;
                case (eTileType.EnemySpawn):
                    Tile = new Objects.TileRed(m_Game);
                    break;
            }

            if (Tile != null)
            {
                Tile.Position = vPos;
                GameState.Get().SpawnGameObject(Tile);
                m_Tiles.AddLast(Tile);
            }

            return Tile;
        }