Added basic components for DSL. Working on functionality next.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Godot;
|
||||
|
||||
public class CraftNode : ProgramNode
|
||||
{
|
||||
public CraftNode()
|
||||
{
|
||||
DisplayText = "Craft";
|
||||
}
|
||||
public override void Execute(Robot robot)
|
||||
{
|
||||
GD.Print("Craft");
|
||||
nextNode.Execute(robot);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dcm23bpi37va
|
||||
@@ -0,0 +1,14 @@
|
||||
using Godot;
|
||||
|
||||
public class HarvestNode : ProgramNode
|
||||
{
|
||||
public HarvestNode()
|
||||
{
|
||||
DisplayText = "Harvest";
|
||||
}
|
||||
public override void Execute(Robot robot)
|
||||
{
|
||||
GD.Print("Harvest");
|
||||
nextNode.Execute(robot);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bb8g5ukg7xnw
|
||||
@@ -0,0 +1,16 @@
|
||||
using Godot;
|
||||
|
||||
public class MoveNode : ProgramNode
|
||||
{
|
||||
public Vector3 startPosition;
|
||||
public Vector3 targetPosition;
|
||||
public MoveNode()
|
||||
{
|
||||
DisplayText = "Move";
|
||||
}
|
||||
public override void Execute(Robot robot)
|
||||
{
|
||||
robot.Position = targetPosition;
|
||||
nextNode.Execute(robot);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://c1yd2vdej67q3
|
||||
@@ -0,0 +1,18 @@
|
||||
using Godot;
|
||||
|
||||
public abstract class ProgramNode
|
||||
{
|
||||
protected ProgramNode nextNode;
|
||||
public string DisplayText;
|
||||
public PackedScene editorDisplay;
|
||||
public ProgramNode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public abstract void Execute(Robot robot);
|
||||
public void LinkNode(ProgramNode nextNode)
|
||||
{
|
||||
this.nextNode = nextNode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://hc0yntn2d358
|
||||
Reference in New Issue
Block a user