2023-04-25 19:46:20 +06:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-01-28 18:37:24 +07:00
|
|
|
using Content.Shared._White.Sponsors;
|
2023-04-25 19:46:20 +06:00
|
|
|
using Robust.Shared.Network;
|
|
|
|
|
|
2024-01-28 17:32:55 +07:00
|
|
|
namespace Content.Client._White.Sponsors;
|
2023-04-25 19:46:20 +06:00
|
|
|
|
|
|
|
|
public sealed class SponsorsManager
|
|
|
|
|
{
|
|
|
|
|
[Dependency] private readonly IClientNetManager _netMgr = default!;
|
|
|
|
|
|
|
|
|
|
private SponsorInfo? _info;
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
_netMgr.RegisterNetMessage<MsgSponsorInfo>(msg => _info = msg.Info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool TryGetInfo([NotNullWhen(true)] out SponsorInfo? sponsor)
|
|
|
|
|
{
|
|
|
|
|
sponsor = _info;
|
|
|
|
|
return _info != null;
|
|
|
|
|
}
|
|
|
|
|
}
|