Exemplo n.º 1
0
 public void ModifyEventsOf(ResortBuilding ofwho, int additivetime)
 {
     foreach (SimulationEvent se in ActiveEvents)
     {
         if (se.Who is Visitor)
         {
             Visitor        v  = se.Who as Visitor;
             ResortBuilding rb = se.EventData as ResortBuilding;
             if (rb == ofwho)
             {
                 ModifyEvent(v, additivetime);
             }
         }
     }
 }
Exemplo n.º 2
0
        private ResortBuilding GetLeastCrowdedBuilding(IEnumerable <ResortBuilding> buildings)
        {
            if (buildings.Count() > 0)
            {
                ResortBuilding best = buildings.First();
                foreach (ResortBuilding rb in buildings)
                {
                    if (rb.EnteredVisitors.Count < best.EnteredVisitors.Count)
                    {
                        best = rb;
                    }
                }

                return(best);
            }

            else
            {
                return(null);
            }
        }