using Insight.Domain.Enums;
using MemoryPack;

namespace Insight.Domain.Network.Remote.Messages;

[MemoryPackable]
public partial class CastRequest : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public RemoteControlMode Mode { get; set; }

    [MemoryPackOrder(2)]
    public string? RequesterName { get; set; }

    [MemoryPackOrder(3)]
    public string? AccessKey { get; set; }
}

[MemoryPackable]
public partial class CastRequestResponse : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(0)]
    public bool Accepted { get; set; }

    [MemoryPackConstructor]
    public CastRequestResponse() { }

    public CastRequestResponse(CastRequest request)
    {
        Id = request.Id;
    }
}

[MemoryPackable]
public partial class CastAbort : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }
}

[MemoryPackable]
public partial class CastMetric : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public DateTimeOffset? Timestamp { get; set; }

    [MemoryPackOrder(2)]
    public double? Mbps { get; set; }

    [MemoryPackOrder(3)]
    public double? Fps { get; set; }

    [MemoryPackOrder(4)]
    public double? RTT { get; set; }
}

[MemoryPackable]
public partial class CastDisplay : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public IEnumerable<string>? DisplayNames { get; set; }

    [MemoryPackOrder(2)]
    public string? SelectedDisplay { get; set; }

    [MemoryPackOrder(3)]
    public int ScreenWidth { get; set; }

    [MemoryPackOrder(4)]
    public int ScreenHeight { get; set; }

    [MemoryPackOrder(5)]
    public string? MachineName { get; set; }
}

[MemoryPackable]
public partial class CastScreen : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public DateTimeOffset? Timestamp { get; set; }

    [MemoryPackOrder(2)]
    public float? ViewWidth { get; set; }

    [MemoryPackOrder(3)]
    public float? ViewHeight { get; set; }

    [MemoryPackOrder(4)]
    public float? Left { get; set; }

    [MemoryPackOrder(5)]
    public float? Top { get; set; }

    [MemoryPackOrder(6)]
    public float? Width { get; set; }

    [MemoryPackOrder(7)]
    public float? Height { get; set; }

    [MemoryPackOrder(8)]
    public byte[]? Image { get; set; }
}

[MemoryPackable]
public partial class CastScreenReceived : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public DateTimeOffset? Timestamp { get; set; }

    [MemoryPackConstructor]
    public CastScreenReceived() { }

    public CastScreenReceived(CastScreen screenData)
    {
        Id = screenData.Id;
        Timestamp = screenData.Timestamp;
    }
}

[MemoryPackable]
public partial class CastCursor : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public int X { get; set; }

    [MemoryPackOrder(2)]
    public int Y { get; set; }

    [MemoryPackOrder(3)]
    public byte[]? Icon { get; set; }
}

[MemoryPackable]
public partial class CastCursorReceived : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public int X { get; set; }

    [MemoryPackOrder(2)]
    public int Y { get; set; }
}

[MemoryPackable]
public partial class CastClipboardReceived : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public string? Text { get; set; }
}

[MemoryPackable]
public partial class CastAudio : IMessage
{
    [MemoryPackOrder(0)]
    public string? Id { get; set; }

    [MemoryPackOrder(1)]
    public byte[]? Buffer { get; set; }
}