public IEnumerable<Place> GetPlaceMap(Place center, int radius) { var max = radius*2; var stack = new Stack<Place>(); stack.Push(center); var list = new List<Place>(); while (stack.Count > 0 && max > 0) { var place = stack.Pop(); list.Add(place); place.Exits.ForEach(stack.Push); max--; } return list; }
public void SavePlace(Place place) { Game.Current.Repository.SavePlace(place); Places[place.Id] = place; }