Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
PathProgress.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Algorithms;
3
4public class PathProgress
5{
6 public enum State
7 {
8 Idle,
11 Fail
12 }
13
15
16 public List<PathFinderNode> nodes = new List<PathFinderNode>();
17
18 public Point startPoint = new Point();
19
20 public Point destPoint = new Point();
21
22 public int nodeIndex;
23
24 public State state;
25
26 public int destDist;
27
28 public int searchLimit;
29
30 public bool ignoreConnection;
31
33
34 public bool HasPath
35 {
36 get
37 {
38 if (state == State.PathReady)
39 {
40 return nodes.Count >= 1;
41 }
42 return false;
43 }
44 }
45
46 public bool IsDestinationReached(Point pos)
47 {
48 return Util.Distance(pos.x, pos.z, destPoint.x, destPoint.z) <= destDist;
49 }
50
51 public void RequestPath(Point _startPoint, Point _destPoint, int _destDist, bool _ignoreConnection, int _searchLimit = -1)
52 {
53 startPoint.Set(_startPoint);
54 destPoint.Set(_destPoint);
55 destDist = _destDist;
56 ignoreConnection = _ignoreConnection;
57 searchLimit = ((_searchLimit == -1) ? PathManager.Instance.searchLimit : _searchLimit);
59 }
60
61 public void RequestPathImmediate(Point _startPoint, Point _destPoint, int _destDist, bool _ignoreConnection, int _searchLimit = -1)
62 {
63 startPoint.Set(_startPoint);
64 destPoint.Set(_destPoint);
65 destDist = _destDist;
66 ignoreConnection = _ignoreConnection;
67 searchLimit = ((_searchLimit == -1) ? PathManager.Instance.searchLimit : _searchLimit);
69 }
70}
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
void RequestPath(PathProgress progress)
Definition: PathManager.cs:31
int searchLimit
Definition: PathManager.cs:22
static PathManager Instance
Definition: PathManager.cs:16
Point startPoint
Definition: PathProgress.cs:18
void RequestPath(Point _startPoint, Point _destPoint, int _destDist, bool _ignoreConnection, int _searchLimit=-1)
Definition: PathProgress.cs:51
Point destPoint
Definition: PathProgress.cs:20
PathManager.MoveType moveType
Definition: PathProgress.cs:32
bool IsDestinationReached(Point pos)
Definition: PathProgress.cs:46
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
bool ignoreConnection
Definition: PathProgress.cs:30
IPathfindWalker walker
Definition: PathProgress.cs:14
void RequestPathImmediate(Point _startPoint, Point _destPoint, int _destDist, bool _ignoreConnection, int _searchLimit=-1)
Definition: PathProgress.cs:61
Definition: Point.cs:9
Point Set(int _x, int _z)
Definition: Point.cs:479
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39