49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using Godot;
|
|
using GoDotTest;
|
|
|
|
namespace GodotComponentTest.tests;
|
|
|
|
public class StreamContainerTests : TestClass {
|
|
private readonly Node _testScene;
|
|
private TileWorld _tileWorld;
|
|
private StreamContainer _streamContainer;
|
|
|
|
private readonly PackedScene _tileWorldScene = GD.Load<PackedScene>("res://scenes/TileWorld.tscn");
|
|
private readonly PackedScene _streamContainerScene = GD.Load<PackedScene>("res://scenes/StreamContainer.tscn");
|
|
|
|
public StreamContainerTests(Node testScene) : base(testScene) {
|
|
_testScene = testScene;
|
|
}
|
|
|
|
[Setup]
|
|
public void Setup() {
|
|
_tileWorld = (TileWorld)_tileWorldScene.Instance();
|
|
_tileWorld.HexGrid = new HexGrid();
|
|
_testScene.AddChild(_tileWorld);
|
|
_streamContainer = (StreamContainer)_streamContainerScene.Instance();
|
|
|
|
foreach (Node node in _testScene.GetChildren()) {
|
|
if (node is TileWorld) {
|
|
_streamContainer.World = node.GetPath();
|
|
}
|
|
}
|
|
|
|
_testScene.AddChild(_streamContainer);
|
|
}
|
|
|
|
[Cleanup]
|
|
public void Cleanup() {
|
|
foreach (Node node in _testScene.GetChildren()) {
|
|
node.QueueFree();
|
|
}
|
|
|
|
_streamContainer.QueueFree();
|
|
_tileWorld.QueueFree();
|
|
}
|
|
|
|
[Test]
|
|
public void Plane2DDistSimple() {
|
|
// _streamContainer.UpdateRects(new Vector2(0, 0));
|
|
// _streamContainer.UpdateRects(new Vector2(1, 0));
|
|
}
|
|
} |