//
//  ContractEventResponder.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 NosSmooth.Core.Contracts;
using NosSmooth.Game.Events;
using NosSmooth.Game.Events.Core;
using Remora.Results;
namespace NosSmooth.Game.Contracts;
/// 
/// A responder that calls Contractor update.
/// 
public class ContractEventResponder : IEveryGameResponder
{
    private readonly Contractor _contractor;
    /// 
    /// Initializes a new instance of the  class.
    /// 
    /// The contractor.
    public ContractEventResponder(Contractor contractor)
    {
        _contractor = contractor;
    }
    /// 
    public Task Respond(TEvent gameEvent, CancellationToken ct = default)
        where TEvent : IGameEvent
        => _contractor.Update(gameEvent, ct);
}