protected virtual void OnTileCleared(LocatedTileEventArgs e) { var ev = TileCleared; if (ev != null) { ev(this, e); } }
protected virtual void OnTileRemoving(LocatedTileEventArgs e) { var ev = TileRemoving; if (ev != null) { ev(this, e); } }
// NB: Consider changing event to give back the original TileStack public void ClearTile(int x, int y) { CheckBoundsFail(x, y); LocatedTileEventArgs ea = new LocatedTileEventArgs(null, x, y); OnTileClearing(ea); ClearTileImpl(x, y); OnTileCleared(ea); }
public void RemoveTile(int x, int y, Tile tile) { CheckBoundsFail(x, y); LocatedTileEventArgs ea = new LocatedTileEventArgs(tile, x, y); OnTileRemoving(ea); RemoveTileImpl(x, y, tile); OnTileRemoved(ea); }
public void AddTile(int x, int y, Tile tile) { CheckBoundsFail(x, y); CheckTileFail(tile); LocatedTileEventArgs ea = new LocatedTileEventArgs(tile, x, y); OnTileAdding(ea); AddTileImpl(x, y, tile); OnTileAdded(ea); }
private void TileRemovingHandler(object sender, LocatedTileEventArgs e) { _fillCommand.QueueRemove(new TileCoord(e.X, e.Y), e.Tile); }
private void TileAddingHandler(object sender, LocatedTileEventArgs e) { _drawCommand.QueueAdd(new TileCoord(e.X, e.Y), e.Tile); }
protected virtual void OnTileRemoving(LocatedTileEventArgs e) { var ev = TileRemoving; if (ev != null) ev(this, e); }
protected virtual void OnTileCleared(LocatedTileEventArgs e) { var ev = TileCleared; if (ev != null) ev(this, e); }