Beispiel #1
0
    /// <summary>
    /// Initializes a new instance of the <see cref="Map"/> class.
    /// </summary>
    /// <param name='tileFactory'>
    /// Tile factory.
    /// </param>
    /// <param name='m'>
    /// M is the length of 1st dimension of the map.
    /// </param>
    /// <param name='n'>
    /// N is the length of 2nd dimemsion of the map.
    /// </param>
    public Map(List <ITile> tiles, ITileFactory tileFactory, ITileLoadingStrategy loadingStrategy, TileView prefab, int m, int n)
    {
        this.prefab          = prefab;
        this.factory         = tileFactory;
        this.loadingStrategy = loadingStrategy;
        this.size            = new Vec2(m, n);
        this.root            = new GameObject("Map");
        this.tileSet         = new Dictionary <Vec2, TileView> (m * n);
        this.visibleTiles    = new List <ITile> (m * n);

        LoadCachedTiles(tiles);
    }
Beispiel #2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="Map"/> class.
    /// </summary>
    /// <param name='tileFactory'>
    /// Tile factory.
    /// </param>
    /// <param name='m'>
    /// M is the length of 1st dimension of the map.
    /// </param>
    /// <param name='n'>
    /// N is the length of 2nd dimemsion of the map.
    /// </param>
    public Map(List<ITile> tiles, ITileFactory tileFactory, ITileLoadingStrategy loadingStrategy, TileView prefab, int m, int n)
    {
        this.prefab = prefab;
        this.factory = tileFactory;
        this.loadingStrategy = loadingStrategy;
        this.size = new Vec2 (m, n);
        this.root = new GameObject ("Map");
        this.tileSet = new Dictionary<Vec2, TileView> (m * n);
        this.visibleTiles = new List<ITile> (m * n);

        LoadCachedTiles (tiles);
    }