// ----------------------------------------------------------------------------- // file="SimpleStateMachineNode" // Project: StgSharp // Copyright (c) Nitload. // SPDX-License-Identifier: MIT // ----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Nitload.State { public abstract class SimpleStateMachineNode where TSelf : SimpleStateMachineNode where TLabel : unmanaged, IEquatable where TStateContext : StateContext { private readonly List _jumpTable = []; public ReadOnlySpan AvailableNodes => CollectionsMarshal.AsSpan(_jumpTable); public abstract bool IsValidateFrom( TSelf former, TStateContext context ); public abstract bool TryTransaction( ReadOnlySpan nodeSpan, TStateContext context, out TLabel label ); } }