• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

First Machine Age's Mods (Combined repo.)


Commit MetaInfo

Revisão5a404147f23f00fe98559caff519d922a958812a (tree)
Hora2020-02-16 09:08:37
Autormelchior <melchior@user...>
Commitermelchior

Mensagem de Log

Updated Logic interface

Mudança Sumário

Diff

--- a/FirstMachineAge_Common/ILogicNetNode.cs
+++ b/FirstMachineAge_Common/ILogicNetNode.cs
@@ -18,14 +18,13 @@ namespace FirstMachineAge
1818
1919 LogicNetwork Circuit { get; } //Per domain (AKA Network ID), encloses several 'sub' circuits (possibly monotonic), all connected (at least 1 io). Zero - considered unassigned or invalid
2020
21- IDictionary<BlockFacing, LogicNetworkSubcircuit> SubCircuits { get; } //A CONNECTED 'Sub' Circuit; MUST be unique for each sub-circuit; an IO going somewhere, doing SOMETHING...
21+ IDictionary<BlockFacing, LogicNetworkSubcircuit> SubCircuits { get; } //A CONNECTED 'Sub' Circuit; MUST be unique for each sub-circuit; an impulse going somewhere, doing SOMETHING...
2222
2323 IDictionary<BlockFacing, bool> VALUEs { get; set;} //Boolean STATE - per face, may/should trigger "events" on changes forced or 'natural'
2424
2525 IDictionary<BlockFacing, EndpointDescriptor> AvailableConnections { get; } //Pins, sockets, connections; Inputs - Outputs, Both? Which faces?? Default Pullups/down???
2626
2727
28-
2928 bool TryGetNetwork(IWorldAccessor world, BlockPos anywhere, out LogicNetwork linkedNet);
3029
3130 bool HasInterface(BlockPos anywhere, BlockFacing face);
@@ -43,11 +42,14 @@ namespace FirstMachineAge
4342
4443 void BreakConnection(BlockFacing cutLinkBySide);
4544
45+ void BreakAllConnections();
46+
47+ event LogicStateChange OnAnyChange;
4648 }
4749
4850 public abstract class LogicDomain
4951 {
50- readonly static string NAME;//TTL, CMOS, Rod-Logic, Cable-Link, Pnumatic, ect...
52+ public readonly static string NAME;//TTL, CMOS, Rod-Logic, Cable-Link, Pnumatic, ect...
5153 //Global ID tag?
5254 //Other information about domain features
5355
@@ -55,27 +57,30 @@ namespace FirstMachineAge
5557
5658 public abstract class LogicNetwork
5759 {
58- LogicDomain ParentDomain { get; }
59- ulong NetworkID { get; }//Monotonic - reuse ID# only at own peril.
60- IList<LogicNetworkSubcircuit> ConnectedSubCircuits { get; }
60+ public LogicDomain ParentDomain { get; }
61+ public ulong NetworkID { get; }//Monotonic - reuse ID# only at own peril.
62+ public IList<LogicNetworkSubcircuit> ConnectedSubCircuits { get; }
6163
6264 }
6365
64- public abstract class LogicNetworkSubcircuit
66+ public abstract class LogicNetworkSubcircuit//A link between Pin, contact, face or perhaps functions?
6567 {
66- uint SubCircuitID { get; }
67- IList<LogicNetworkSubcircuit> AtttachedNodes { get; }
68- LogicNetwork ParentCircuit { get; }
68+ public uint SubCircuitID { get; }
69+ public IList<LogicNetworkSubcircuit> AtttachedNodes { get; }
70+ public LogicNetwork ParentCircuit { get; }
71+ public EndpointDescriptor LocalPoint{ get; }
72+ public bool PreviousState { get; }
73+ public event LogicStateChange OnChange;
6974 }
7075
7176 //As it might change 'dyamically' or be editable...
7277 public abstract class EndpointDescriptor
7378 {
74- sbyte Number { get; }
75- readonly string Description;
76- BlockFacing ForFace { get; }
77- LogicIO EndKind { get; }
78- DefaultState Normally { get; }
79+ public sbyte Number { get; }
80+ public readonly string Description;//Name of Pin or Contact or function
81+ public BlockFacing ForFace { get; }
82+ public LogicIO EndKind { get; }
83+ public DefaultState Normally { get; }
7984 }
8085
8186 public enum LogicIO
@@ -93,6 +98,9 @@ namespace FirstMachineAge
9398 Undefined//! - Mabey Random, or can't be determined before execution
9499 }
95100
101+ public delegate void LogicStateChange(LogicNetworkSubcircuit origin, bool from, bool to);//Same state ~ pulse?
102+
103+
96104
97105 }
98106