Bracket System & Godot Upgrade To 4.3 RC1

This commit is contained in:
h z
2024-07-30 17:59:52 +01:00
parent bae0a52e3f
commit a9afe94ebc
8 changed files with 52 additions and 14 deletions

View File

@@ -0,0 +1,16 @@
namespace Nocturnis.Hermeteus;
public static class EBracketRouter
{
public static IBracketRouter RouteAndSkip(this IBracketRouter router)
{
IBracketRouter pr = router.Route();
while (pr is IBracketTalk { CanSkip: true } prt)
{
prt.Finished = true;
pr = pr.RouteAndSkip();
}
return pr;
}
}

View File

@@ -1,3 +1,4 @@
using Nocturnis.Hermeteus.Processors;
using Skeleton.DataStructure.Tree;
namespace Nocturnis.Hermeteus;
@@ -6,4 +7,6 @@ public interface IBracketStory : IBracketRouter
{
IBracketChapter CurrentChapter { get; set; }
IBracketChapter[] Children { get; set; }
IBracketRouter CurrentRouter { get; set; }
bool Process(IBracketProcessor processor);
}

View File

@@ -14,4 +14,5 @@ public interface IBracketTalk : IBracketRouter
HashSet<ICondition> Conditions { get; set; }
Vector2[] ArrowMarkers { get; set; }
bool Finished { get; set; }
bool CanSkip { get; set; }
}

View File

@@ -0,0 +1,13 @@
using Godot;
using Nocturnis.UIElements.Layers;
namespace Nocturnis.Hermeteus;
public interface IInstructionAgent : INodeInterface
{
void Load(string content, Action callBack);
void Clean(Action callBack);
void LoadArrows(Vector2[] ends);
void CleanArrows();
void Init(IInstructionLayer insLayer);
}

View File

@@ -4,13 +4,14 @@ namespace Nocturnis.Hermeteus.Processors;
public interface IBracketProcessor
{
IInstructionHint Bra { get; }
IInstructionHint Ket { get; }
IInstructionAgent Bra { get; set; }
IInstructionAgent Ket { get; set; }
void BraCallback();
void KetCallback();
bool BraFinished { get; set; }
bool KetFinished { get; set; }
double BracketEsc { get; set; }
string Status { get; set; }
void Process(double delta);
void Init(IInstructionAgent bra, IInstructionAgent pointer, IInstructionAgent ket);
void SyncLoad(IBracketTalk talk);
}

View File

@@ -1,4 +1,5 @@
using Godot;
using Nocturnis.Hermeteus;
using Nocturnis.UIElements;
using Nocturnis.UIElements.Layers;
@@ -10,6 +11,5 @@ public interface IRootScene
IKeyListener KeyListener { get; set; }
TextureButton EngineSwitch { get; set; }
IWindowLayer WindowLayer { get; set; }
IInstructionHint Bra { get; set; }
IInstructionHint Ket { get; set; }
IInstructionLayer InstructionLayer { get; set; }
}

View File

@@ -1,9 +0,0 @@
namespace Nocturnis.UIElements;
public interface IInstructionHint : INodeInterface
{
void Load(string content);
void Load(string content, Action callBack);
void Clean();
void Clean(Action callBack);
}

View File

@@ -0,0 +1,13 @@
using Nocturnis.Hermeteus;
using Nocturnis.Hermeteus.Processors;
namespace Nocturnis.UIElements.Layers;
public interface IInstructionLayer : INodeInterface
{
IInstructionAgent Bra { get; set; }
IInstructionAgent Pointer { get; set; }
IInstructionAgent Ket { get; set; }
IBracketProcessor Processor { get; set; }
void Init();
}