Bracket System & Godot Upgrade To 4.3 RC1
This commit is contained in:
16
src/Hermeteus/EBracketRouter.cs
Normal file
16
src/Hermeteus/EBracketRouter.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
13
src/Hermeteus/IInstructionAgent.cs
Normal file
13
src/Hermeteus/IInstructionAgent.cs
Normal 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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
13
src/UIElements/Layers/IInstructionLayer.cs
Normal file
13
src/UIElements/Layers/IInstructionLayer.cs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user