public TileDecal(Sprite _sprite, Vector2D _position, Tile _tile, Color color) { sprite = _sprite; position = _position; tile = _tile; sprite.Color = color; }
private void SetSpritesAround(Tile t) { Tile[] tiles = (Tile[])GetAllWallIn(new RectangleF(t.Position.X - (TileSpacing / 2f), t.Position.Y - (TileSpacing / 2f), TileSpacing * 2, TileSpacing * 2)); foreach (Tile u in tiles) { if(u != t) u.SetSprite(); } }
private void TileChanged(Tile t) { if (OnTileChanged != null) OnTileChanged(t.Position); }
private Rectangle TilePos(Tile T) { return new Rectangle((int)(T.Position.X), (int)(T.Position.Y), TileSpacing, TileSpacing); }
private void RemoveTile(Tile t) { if (t.GetType().Name == "Wall") { _wallArray.Remove(t); SetSpritesAround(t); } else { _groundArray.Remove(t); } }
public void AddTile(Tile t) { if (t.GetType().Name == "Wall") { _wallArray.Insert(t); SetSpritesAround(t); } else { _groundArray.Insert(t); } }