internal FollowController(AI_StateMachine ai)
        {
            this.pathToFollow = new Queue <Vector2>();
            this.ai           = ai;
            this.leader       = ai.player;
            this.follower     = ai.npc;
            this.pathFinder   = new PathFinder(this.follower.currentLocation, this.follower, this.leader);
            this.joystick     = new FollowJoystick(ref this.follower, this.pathFinder);

            this.ai.LocationChanged += this.Ai_LocationChanged;
            this.joystick.Move      += this.OnMove;
        }
예제 #2
0
        public ForageController(AI_StateMachine ai, IModEvents events)
        {
            this.ai         = ai;
            this.ignoreList = new List <TerrainFeature>();
            this.pathFinder = new PathFinder(this.Forager.currentLocation, this.Forager, this.ai.player);
            this.joystick   = new FollowJoystick(this.Forager, this.pathFinder);
            this.joystick.EndOfRouteReached += this.Joystick_EndOfRouteReached;
            this.ai.LocationChanged         += this.Ai_LocationChanged;
            this.r = new Random((int)Game1.uniqueIDForThisGame + (int)Game1.stats.DaysPlayed);
            this.foragedObjects = new Stack <Item>();
            this.forages        = this.LoadForages();

            events.GameLoop.TimeChanged += this.GameLoop_TimeChanged;
        }