diff options
Diffstat (limited to 'scripts/actors/AI/BaseAI.cs')
| -rw-r--r-- | scripts/actors/AI/BaseAI.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/actors/AI/BaseAI.cs b/scripts/actors/AI/BaseAI.cs new file mode 100644 index 0000000..f9b5387 --- /dev/null +++ b/scripts/actors/AI/BaseAI.cs @@ -0,0 +1,20 @@ +using Godot; + +public abstract partial class BaseAI : Node { + protected Actor body; + + public override void _Ready() + { + base._Ready(); + body = GetParent<Actor>(); + } + + public abstract void Perform(); + + public Godot.Collections.Array<Vector2> GetPathTo(Vector2I destination) { + Godot.Collections.Array<Vector2> list = []; + Vector2[] path = body.Map_Data.Pathfinder.GetPointPath(body.GridPosition, destination); + list.AddRange(path); + return list; + } +}
\ No newline at end of file |
