public void BuildingDestroyed(Building b) { if (!b.Definition.Prerequisite.HasValue) { return; } var prerequisite = TechTree.Buildings[b.Definition.Prerequisite.Value]; if (!Buildings.Any(other => other.Definition == prerequisite)) { AvailableBuildings.Remove(b.Definition); } }
public bool HaveBuilding(Location location) { return(Buildings.Any(u => u.Location.X == location.X && u.Location.Y == location.Y)); }