Example #1
0
 public GameController(
     IGameService gameService,
     ILocationParser locationParser)
 {
     _gameService    = gameService;
     _locationParser = locationParser;
 }
Example #2
0
 public Action(ITarget target, T directObject, ILocationParser locationParser, ActionType actionType = ActionType.Execute)
 {
     this._target         = target;
     this._directObject   = directObject;
     this._locationParser = locationParser;
     this._actionType     = actionType;
 }
        private Queue <IAction> ActionToWarp()
        {
            Queue <IAction> actions = new Queue <IAction>();

            if (this._path.Count == 0)
            {
                this.FindPathToNextLocation();
            }

            ILocationParser next = this._path.Dequeue();

            IList <Warp> warps = this._ordered[this._current].GetWarps();

            foreach (Warp warp in warps)
            {
                if (warp.TargetName == next.GetName())
                {
                    IAction action = new ActionTile(null, this._ordered[this._current].WarpToTile(warp), this._ordered[this._current], ActionType.Navigate);
                    actions.Enqueue(action);
                    break;
                }
            }

            return(actions);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TribePadJobParser"/> class.
 /// </summary>
 /// <param name="lookupValuesProvider">A method of supplying lookup values for identifiers referenced by the job data</param>
 /// <param name="salaryParser">A method of parsing salary information for the job</param>
 /// <param name="workPatternParser">A method of parsing work pattern information for the job</param>
 /// <param name="locationParser">A method of parsing locations for a job</param>
 /// <param name="applyUrl">The URL to apply for a job, with {0} to represent where the job id should be used</param>
 /// <exception cref="ArgumentNullException">lookupValuesProvider or salaryParser or workPatternParser or applyUrl</exception>
 public TribePadJobParser(IJobsLookupValuesProvider lookupValuesProvider, ISalaryParser salaryParser, IWorkPatternParser workPatternParser, ILocationParser locationParser, Uri applyUrl)
 {
     _lookupValuesProvider = lookupValuesProvider ?? throw new ArgumentNullException(nameof(lookupValuesProvider));
     _salaryParser         = salaryParser ?? throw new ArgumentNullException(nameof(salaryParser));
     _workPatternParser    = workPatternParser ?? throw new ArgumentNullException(nameof(workPatternParser));
     _locationParser       = locationParser ?? throw new ArgumentNullException(nameof(locationParser));
     _applyUrl             = applyUrl ?? throw new ArgumentNullException(nameof(applyUrl));
 }
 public LocationRelatedCommand(ILocationParser locationParser = null)
 {
     if (locationParser == null)
     {
         this.locationParser = new LocationParser();
     }
     else
     {
         this.locationParser = locationParser;
     }
 }
 public ActionObject(
     ITarget target,
     StardewValley.Object directObject,
     ILocationParser locationParser,
     ActionType actionType = ActionType.Execute
     ) : base(
         target,
         directObject,
         locationParser,
         actionType
         )
 {
 }
 public ActionCharacter(
     ITarget target,
     Character directObject,
     ILocationParser locationParser,
     ActionType actionType = ActionType.Execute
     ) : base(
         target,
         directObject,
         locationParser,
         actionType
         )
 {
 }
 public ActionTile(
     ITarget target,
     ITile directObject,
     ILocationParser locationParser,
     ActionType actionType = ActionType.Execute
     ) : base(
         target,
         directObject,
         locationParser,
         actionType
         )
 {
 }
 // (b) you can use MOCKED version of the parser object for testing purposes
 public LocationTranslator(ILocationParser parser)
 {
     _parser = parser;
 }
Example #10
0
 public ShipFactory(ILocationParser locationParser)
 {
     _locationParser = locationParser;
 }