44 lines
637 B
C#
44 lines
637 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Godot;
|
|
|
|
public partial class Robot : Node3D
|
|
{
|
|
List<ProgramNode> nodes;
|
|
bool isExecuting = false;
|
|
ProgramNode currentNode;
|
|
|
|
public override void _Ready()
|
|
{
|
|
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (isExecuting)
|
|
{
|
|
if (currentNode.Execute(this, delta))
|
|
{
|
|
currentNode = currentNode.nextNode;
|
|
if (currentNode == null)
|
|
{
|
|
isExecuting = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
public void Move()
|
|
{
|
|
|
|
}
|
|
|
|
public void SetupExecution(List<ProgramNode> nodes)
|
|
{
|
|
this.nodes = [.. nodes];
|
|
isExecuting = true;
|
|
currentNode = nodes[0];
|
|
}
|
|
|
|
}
|