// // ContractBuilder.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Threading.Tasks; using Remora.Results; namespace NosSmooth.Core.Contracts; /// /// Builds with given states /// and errors. /// /// The data type. /// The states. /// The errors that may be returned. public class ContractBuilder where TState : struct, IComparable where TError : struct where TData : notnull { private readonly Contractor _contractor; private readonly TState _defaultState; private TState? _fillAtState; private DefaultContract.FillDataAsync? _fillData; private Dictionary.StateActionAsync> _actions; /// /// Initializes a new instance of the class. /// /// The contractor. /// The default state of the contract. public ContractBuilder(Contractor contractor, TState defaultState) { _contractor = contractor; _defaultState = defaultState; _actions = new Dictionary.StateActionAsync>(); } public ContractBuilder SetMoveFilter(TState state, Func filter, TState nextState) { } public ContractBuilder SetMoveFilter(TState state, TState nextState) { } public ContractBuilder SetFillData(TState state, Func> fillData) { _fillAtState = state; _fillData = fillData; } public ContractBuilder SetError(TState state, Func error, TState nextState) { } public ContractBuilder SetMoveAction(TState state, Func>> actionFilter, TState nextState) { } public ContractBuilder SetPacketError(TState state, Func error, TState nextState) { } public IContract Build() { new DefaultContract() } }