public Tile MakeTile(int x, int y, string s) { TileTerrain t = InitTerrain(char.ToUpper(s[0])); TileObject obj = InitObject(s, new Vector2i(x, y)); var tile = new Tile(x, y, t, obj); //tile.tileObject.Remove += (o) => tile.tileObject = null; return(tile); }
public Tile MakeTile(int x, int y, string s) { TileTerrain t = InitTerrain(char.ToUpper(s[0])); TileObject obj = InitObject(s, new Location(y, x)); var tile = new Tile(x, y, t, obj); if (tile.tileObject != null) { tile.tileObject.Remove += (o) => tile.tileObject = null; } return(tile); }
public Tile(Location location, TileTerrain t, List <TileObject> objects) { Location = location; Terrain = t; foreach (var obj in objects) { obj.Remove += o => objects.Remove(o); } this.objects = objects; }
private TileTerrain InitTerrain(char c) { return(TileTerrain.Parse(c)); }
public Tile(int x, int y, TileTerrain t, List <TileObject> obj) : this(new Location(y, x), t, obj) { }