public static Map FromTileset(TileSet tileset) { var size = new Size(1, 1); var tileShape = Game.modData.Manifest.TileShape; var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); var makeMapTiles = Exts.Lazy(() => { var ret = new CellLayer <TerrainTile>(tileShape, size); ret.Clear(tileRef); return(ret); }); var map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(size), Tileset = tileset.Id, Options = new MapOptions(), MapResources = Exts.Lazy(() => new CellLayer <ResourceTile>(tileShape, size)), MapTiles = makeMapTiles, Actors = Exts.Lazy(() => new Dictionary <string, ActorReference>()), Smudges = Exts.Lazy(() => new List <SmudgeReference>()) }; map.PostInit(); return(map); }
public static Map FromTileset(TileSet tileset) { var tile = tileset.Templates.First(); var tileRef = new TileReference <ushort, byte> { Type = tile.Key, Index = (byte)0 }; Map map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(1, 1), Tileset = tileset.Id, Options = new MapOptions(), MapResources = Exts.Lazy(() => new TileReference <byte, byte> [1, 1]), MapTiles = Exts.Lazy(() => new TileReference <ushort, byte>[1, 1] { { tileRef } }), Actors = Exts.Lazy(() => new Dictionary <string, ActorReference>()), Smudges = Exts.Lazy(() => new List <SmudgeReference>()) }; map.PostInit(); return(map); }
public static Map FromTileset(TileSet tileset) { var size = new Size(1, 1); var tileShape = Game.ModData.Manifest.TileShape; var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); var makeMapTiles = Exts.Lazy(() => { var ret = new CellLayer <TerrainTile>(tileShape, size); ret.Clear(tileRef); return(ret); }); var makeMapHeight = Exts.Lazy(() => { var ret = new CellLayer <byte>(tileShape, size); ret.Clear(0); return(ret); }); var map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(size), Tileset = tileset.Id, Videos = new MapVideos(), Options = new MapOptions(), MapResources = Exts.Lazy(() => new CellLayer <ResourceTile>(tileShape, size)), MapTiles = makeMapTiles, MapHeight = makeMapHeight, SpawnPoints = Exts.Lazy(() => new CPos[0]) }; map.PostInit(); return(map); }
public static Map FromTileset(TileSet tileset) { var size = new Size(1, 1); var tileShape = Game.ModData.Manifest.TileShape; var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); var makeMapTiles = Exts.Lazy(() => { var ret = new CellLayer<TerrainTile>(tileShape, size); ret.Clear(tileRef); return ret; }); var makeMapHeight = Exts.Lazy(() => { var ret = new CellLayer<byte>(tileShape, size); ret.Clear(0); return ret; }); var map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(size), Tileset = tileset.Id, Videos = new MapVideos(), Options = new MapOptions(), MapResources = Exts.Lazy(() => new CellLayer<ResourceTile>(tileShape, size)), MapTiles = makeMapTiles, MapHeight = makeMapHeight, SpawnPoints = Exts.Lazy(() => new CPos[0]) }; map.PostInit(); return map; }
public static Map FromTileset(TileSet tileset) { var size = new Size(1, 1); var tileShape = Game.modData.Manifest.TileShape; var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); var makeMapTiles = Exts.Lazy(() => { var ret = new CellLayer<TerrainTile>(tileShape, size); ret.Clear(tileRef); return ret; }); var map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(size), Tileset = tileset.Id, Options = new MapOptions(), MapResources = Exts.Lazy(() => new CellLayer<ResourceTile>(tileShape, size)), MapTiles = makeMapTiles, Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>()), Smudges = Exts.Lazy(() => new List<SmudgeReference>()) }; map.PostInit(); return map; }
public static Map FromTileset(TileSet tileset) { var tile = tileset.Templates.First(); var tileRef = new TileReference<ushort, byte> { Type = tile.Key, Index = (byte)0 }; Map map = new Map() { Title = "Name your map here", Description = "Describe your map here", Author = "Your name here", MapSize = new int2(1, 1), Tileset = tileset.Id, Options = new MapOptions(), MapResources = Exts.Lazy(() => new TileReference<byte, byte>[1, 1]), MapTiles = Exts.Lazy(() => new TileReference<ushort, byte>[1, 1] { { tileRef } }), Actors = Exts.Lazy(() => new Dictionary<string, ActorReference>()), Smudges = Exts.Lazy(() => new List<SmudgeReference>()) }; map.PostInit(); return map; }