public static void DrawObjectInTile(Tile t) { TileWithObject tile = t as TileWithObject; if (tile != null && !tile.Empty) Draw(tile.ObjectInTile); }
public TileWithObject(Tile t, BaseObject baseObject, bool resize = false) : base(t.TexturePath, t.Rectangle) { if (baseObject == null) return; Put(baseObject, resize); }
public TileData(Tile t) { TexturePath = t.TexturePath; SoundEffectPath = t.EffectPath; Dimensions = new Vector2(t.Width, t.Height); Coordinates = t.Coordinates; Solid = t.Solid; Empty = t.Empty; Color = t.Color; }
public Tile[,] CreateMap() { Tile[,] map = new Tile[TilesAcross, TilesDown]; for(int col = 0; col < TilesDown; col++) for (int row = 0; row < TilesAcross; row++) { map[row, col] = CreateTile(row, col); } return map; }
public static void DrawTileMap(Tile[,] drawTiles) { foreach (Tile t in drawTiles) { DrawStuff.Draw(t); DrawObjectInTile(t); } }
public TileWithObject(Tile t) : base(t.TexturePath, t.Rectangle) { this.objectInTile = null; this.Empty = true; }
public static TileData CreateTileData(Tile t) { return new TileData(t); }
public void SetFocusedTiles(Tile[,] tile) { focusedTiles = tile; }
private Tile[,] GetFocusedTiles() { Tile[,] focusTiles = new Tile[MaxColsToDraw, MaxRowsToDraw]; int x, y; x = y = 0; for (int col = StartCol; col < StartCol + MaxColsToDraw; col++) { for (int row = StartRow; row < StartRow + MaxRowsToDraw; row++) { Tile tile = map[col, row]; focusTiles[x, y] = map[col, row]; y++; } y = 0; x++; } return focusTiles; }
public Tile(Tile tile) : base(tile.TexturePath, tile.Rectangle) { }