public Boolean FoodSiteAvailable(FoodSite foodSite) { if (!this.mediatorMap.ContainsKey(foodSite)) { return(true); } return(this.mediatorMap[foodSite].FoodSiteAvailable()); }
public Boolean TryVisitFoodSite(FoodSite foodSite, Blob b) { if (!this.mediatorMap.ContainsKey(foodSite)) { this.mediatorMap.TryAdd(foodSite, new FoodSiteMediator(foodSite)); } return(this.mediatorMap[foodSite].TryVisit(b)); }
private void PlaceFoodRandomly(int numFood) { for (int i = 0; i < numFood; i++) { FoodSite food = new FoodSite(); food.SetPosition(new RadialPosition(rng.NextDouble(), 2 * Math.PI * rng.NextDouble())); this.food.Add(food); } }
public override Boolean Equals(object obj) { if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } FoodSite food = (FoodSite)obj; return(this.id == food.id); }
internal Boolean FoodSiteAvailable(FoodSite foodSite) { ensureSimulationActive(); return(this.mediatorStore.FoodSiteAvailable(foodSite)); }
internal Boolean TryVisitFoodSite(FoodSite foodSite, Blob b) { ensureSimulationActive(); return(this.mediatorStore.TryVisitFoodSite(foodSite, b)); }
public FoodSiteMediator(FoodSite fs) { this.foodSite = fs; this.blobs = new List <Blob>(); }
public AtFoodSiteState(Blob b, FoodSite foodSite) : base(b) { this.foodSite = foodSite; }