Version 3.0.0
What's Changed
- feat: generator improvements, vanilla events (for performance), allow triggering initial state side effects, minor bindings fixes by @definitelyokay in #17
- feat: reduce generics by @definitelyokay in #18
- removes generics for
input
andoutput
— they are both just of typeobject
as far as logic blocks is concerned. this drastically reduces boilerplate when creating logic blocks and will substantially simplify errors while developing. - fixes generator to infer inputs and outputs from usage, as opposed to relying on subtypes.
- changes all examples and test fixtures to use
readonly record struct
types for input and output types, as well as sets forth the convention of organizing inputs and outputs in static classes inside a logic block subclass. - overhauled documentation in the readme, complete with the latest up-to-date code examples and diagrams
- bumps version to 3.0, given these major breaking changes.
- makes seperate versions of
StateLogic
forLogicBlock
andLogicBlockAsync
so that states can trigger enter/exit callbacks themselves. - removes the state tester in favor of asking states to re-enter and re-exit.
- overhauls the tutorial on creating a space heater to create a much cleaner and more realistic, real-world type of example.
- Removed WeakEvent for the sake of performance and API usage. Looked like it was allocating a list on every invocation. Would rather just use .NET's underlying Multicast delegates that power vanilla C# events.
- Bindings now unsubscribe input and error event channels — was a small oversight.
- Added public api methods,
Enter
, andExit
onStateLogic
, allowing you to manually trigger entrance/exit callbacks whenever you want. You can even provide the next or previous state (respectively), allowing only the relevant callbacks to be triggered based on the type. - Added test case showing that structs can be used for inputs and outputs. Using structs for outputs should prevent them from ever having to hit the heap, meaning you could spam producing struct outputs as much as you want. 😀
Full Changelog: v2.4.1...v3.0.0