summaryrefslogtreecommitdiff
path: root/scripts/actors/AI/BaseAI.cs
blob: f9b53875f3eac1f6e37ad48784d5885d9f73bdbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
	}
}