예제 #1
0
파일: Map.cs 프로젝트: Szune/Elysian-Fields
        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);
        }
예제 #2
0
 public void GeneratePathFromCreature(Creature FromCreature, Coordinates Target)
 {
     FromCreature.Destination = Target;
     FromCreature.ResetPath();
     AI ai = new AI(this);
     FromCreature.Path = ai.PathTo(Target, FromCreature.Position);
 }
예제 #3
0
파일: Map.cs 프로젝트: Szune/Elysian-Fields
        // 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);
        }