2023-02-16 09:25:33 +00:00
|
|
|
|
using Pal.Client.Configuration;
|
|
|
|
|
using Pal.Client.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace Pal.Client.Scheduled
|
2022-12-22 00:01:09 +00:00
|
|
|
|
{
|
2023-02-15 22:17:19 +00:00
|
|
|
|
internal sealed class QueuedConfigUpdate : IQueueOnFrameworkThread
|
2022-12-22 00:01:09 +00:00
|
|
|
|
{
|
2023-02-16 09:25:33 +00:00
|
|
|
|
internal sealed class Handler : IQueueOnFrameworkThread.Handler<QueuedConfigUpdate>
|
|
|
|
|
{
|
|
|
|
|
private readonly IPalacePalConfiguration _configuration;
|
|
|
|
|
private readonly FloorService _floorService;
|
|
|
|
|
private readonly TerritoryState _territoryState;
|
|
|
|
|
|
|
|
|
|
public Handler(IPalacePalConfiguration configuration, FloorService floorService,
|
|
|
|
|
TerritoryState territoryState)
|
|
|
|
|
{
|
|
|
|
|
_configuration = configuration;
|
|
|
|
|
_floorService = floorService;
|
|
|
|
|
_territoryState = territoryState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Run(QueuedConfigUpdate queued, ref bool recreateLayout, ref bool saveMarkers)
|
|
|
|
|
{
|
|
|
|
|
if (_configuration.Mode == EMode.Offline)
|
|
|
|
|
{
|
|
|
|
|
LocalState.UpdateAll();
|
|
|
|
|
_floorService.FloorMarkers.Clear();
|
|
|
|
|
_floorService.EphemeralMarkers.Clear();
|
|
|
|
|
_territoryState.LastTerritory = 0;
|
|
|
|
|
|
|
|
|
|
recreateLayout = true;
|
|
|
|
|
saveMarkers = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-22 00:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|