Spite up project, added BeltData, some asoited compoents, remvoed unused usings, and removed uneeded comment code.

This commit is contained in:
2026-05-10 12:33:20 -04:00
parent d620189e4e
commit 4db51be374
53 changed files with 1892 additions and 608 deletions

View File

@@ -1,8 +1,8 @@
using System.Diagnostics;
using ChickenGameTest;
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System;
[Meta(typeof(IAutoNode))]
public partial class ConveyorBeltStraight : Node3D, IProvide<IVoxelGridRegistry>
{
@@ -16,19 +16,21 @@ public partial class ConveyorBeltStraight : Node3D, IProvide<IVoxelGridRegistry>
get => GridTransform3D.FromGodot(GlobalTransform);
set => GlobalTransform = value.ToGodot();
}
[Node("ConveyorLogic")]
public TestItemConveyor ConveyorLogic { get; set; } = default!;
public override void _Ready()
{
var node = GetNode("Node") as TestItemConveyor;
base._Ready();
Debug.Assert(ConveyorLogic is not null, $"{nameof(ConveyorLogic)} is not set on {nameof(ConveyorBeltStraight)}, Path {SceneFilePath}");
// GD.PrintS(VoxelTransform.Origin,VoxelTransform.Forward);
node.StartPort = node.CreatePort(
ConveyorLogic.StartPort = ConveyorLogic.CreatePort(
new(VoxelTransform.TranslatedLocal(new(1 - Width, 0, 0)).RotateY(2),
// Direction.Back,
Width,
PortAccess.BiDirectional),
new BeltTEnd(ConveyorEnd.Start),
new LaneSpan(0, 1));
node.EndPort = node.CreatePort(
ConveyorLogic.EndPort = ConveyorLogic.CreatePort(
new(VoxelTransform, //new(GridTransform3D.FromGodot(Transform.TranslatedLocal(Vector3.Left)),
// Direction.Front,
Width,
@@ -36,22 +38,23 @@ public partial class ConveyorBeltStraight : Node3D, IProvide<IVoxelGridRegistry>
new BeltTEnd(ConveyorEnd.End),
new LaneSpan(0, 1));
node.OtherPorts = [
node.CreatePort(
ConveyorLogic.OtherPorts = [
ConveyorLogic.CreatePort(
new(VoxelTransform.RotateY90CW(),
// Direction.Right,
1,
PortAccess.In),
new BeltTOffset(node.Length/2),
new BeltTOffset(ConveyorLogic.Length/2),
LaneSpan.One),
node.CreatePort(
ConveyorLogic.CreatePort(
new(VoxelTransform.RotateY90CCW(),
// Direction.Left,
1,
PortAccess.In),
new BeltTOffset(node.Length/2),
new BeltTOffset(ConveyorLogic.Length/2),
LaneSpan.One)
];
}
public void OnResolved()
{

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://c4h7mwnfrdesg"]
[gd_scene format=3 uid="uid://c4h7mwnfrdesg"]
[ext_resource type="Script" uid="uid://dgyuh6un1qoj4" path="res://src/Conveyors/ConveyorBeltStraight/ConveyorBeltStraight.cs" id="1_mn8ro"]
[ext_resource type="Script" uid="uid://j24fuotdwwx4" path="res://src/VoxelGrid/TestItemConveyor.cs" id="2_1vr1d"]
@@ -13,22 +13,23 @@ _data = {
}
point_count = 2
[node name="ConveyorBeltStraight" type="Node3D"]
[node name="ConveyorBeltStraight" type="Node3D" unique_id=1032197109]
script = ExtResource("1_mn8ro")
Width = 1
[node name="Node" type="Node" parent="."]
[node name="ConveyorLogic" type="Node" parent="." unique_id=1693852977]
script = ExtResource("2_1vr1d")
[node name="conveyor-sides" parent="." instance=ExtResource("2_mn8ro")]
[node name="conveyor-sides" parent="." unique_id=516239399 instance=ExtResource("2_mn8ro")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0, 0)
[node name="arrow-basic2" parent="." instance=ExtResource("3_1vr1d")]
[node name="arrow-basic2" parent="." unique_id=1668302786 instance=ExtResource("3_1vr1d")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.21879572, 0)
[node name="Path3D" type="Path3D" parent="."]
[node name="Path3D" type="Path3D" parent="." unique_id=878303794]
curve = SubResource("Curve3D_x5qdr")
[node name="Node2" type="Node" parent="." node_paths=PackedStringArray("Path3D", "ItemConveyor")]
[node name="Node2" type="Node" parent="." unique_id=1875202216 node_paths=PackedStringArray("Path3D", "ItemConveyor")]
script = ExtResource("4_g7n1f")
Path3D = NodePath("../Path3D")
ItemConveyor = NodePath("../Node")
ItemConveyor = NodePath("../ConveyorLogic")