Example #1
0
 public void SetTile(int x, int y, int tx, int ty)
 {
     _blocks[x + y * _width] = new MapBlock(BlockType.Solid, (ushort)(tx + ty * 16));
 }
Example #2
0
        private void RemoveUnusedTilesetsAndZeroBase(List<int> flattened, List<Tsx> tsxs)
        {
            Blocks = new List<MapBlock>();

            var emptyBlock = new MapBlock(BlockType.Empty, 0);

            Blocks = (	from gid in flattened
                        let tsx = tsxs.Find(t => t.SpawnsOnly && gid >= t.FirstGid && gid <= t.LastGid)
                        let localId = (int)Math.Max (0, ((int)gid - tsx.FirstGid - 1))
                        select gid == 0 ? emptyBlock : new MapBlock(tsx.BlockTypes[localId + 1], (ushort)localId)
                      ).ToList();

            // Output tileset paths
            TilemapNames = (from tsx in tsxs where tsx.SpawnsOnly select tsx.TilemapName).ToList();
        }