internal void GeneratePathFromPlayer(Creature FromCreature, Coordinates Target, int DistanceTo = 20) { FromCreature.Destination = Target; FromCreature.ResetPath(); AI ai = new AI(); PathfindingTask = Task.Factory.StartNew(() => { FromCreature.Path = ai.PathTo(Target, FromCreature.Position, DistanceTo); } ); //FromCreature.Path = ai.PathTo(Target, FromCreature.Position, DistanceTo); }
public void GeneratePathFromCreature(Creature FromCreature, Coordinates Target) { FromCreature.Destination = Target; FromCreature.ResetPath(); AI ai = new AI(this); FromCreature.Path = ai.PathTo(Target, FromCreature.Position); }
// Map(Coordinates WindowSize) { windowSize = WindowSize; } internal void GeneratePathFromCreature(Creature FromCreature, Coordinates Target, int DistanceTo = 20) { FromCreature.ResetPath(); PathfindingTask = Task.Factory.StartNew(() => { AI ai = new AI(); FromCreature.Path = ai.Monster_PathTo(Target, FromCreature.Position, DistanceTo); if (FromCreature.Path.Count > 0) { FromCreature.Destination = Coordinates.Parse(FromCreature.Path[0]); } } ); //FromCreature.Path = ai.PathTo(Target, FromCreature.Position, DistanceTo); }