Exemple #1
0
        protected IEnumerable <ActionType> getDriveActions(TravelSearchState state, TravelWorld world)
        {
            List <ActionType>        res = new List <ActionType>();
            IEnumerable <TravelEdge> ways;

            if (state.CarryWatter)
            {
                ways = world.GetWays(state.CurrentLocation);
            }
            else
            {
                ways = world.GetClearWays(state.CurrentLocation);
            }

            foreach (var way in ways)
            {
                int dest   = way.getAnotherPlace(state.CurrentLocation);
                var action = new ActionType(w => drive(w, dest));
                res.Add(action);
            }
            return(res);
        }