1
0
Fork 0
forked from aly/qstbak

qstcompanion v1.0.6

This commit is contained in:
alydev 2025-12-07 10:54:53 +10:00
parent 5e1e1decc5
commit ada27cf05b
30 changed files with 3403 additions and 426 deletions

View file

@ -0,0 +1,35 @@
using System;
using Newtonsoft.Json;
namespace QuestionableCompanion.Models;
public class LANMessage
{
public LANMessageType Type { get; set; }
public DateTime Timestamp { get; set; } = DateTime.Now;
public string? Data { get; set; }
public LANMessage()
{
}
public LANMessage(LANMessageType type, object? data = null)
{
Type = type;
if (data != null)
{
Data = JsonConvert.SerializeObject(data);
}
}
public T? GetData<T>()
{
if (string.IsNullOrEmpty(Data))
{
return default(T);
}
return JsonConvert.DeserializeObject<T>(Data);
}
}