using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Assets.Scripts;
using Assets.Scripts.Objects.Electrical;
using HarmonyLib;
using JetBrains.Annotations;
using RemoteControl.Message;
using Swan;
using GameDevice = Assets.Scripts.Objects.Pipes.Device;

namespace RemoteControl.Patches
{
    [HarmonyPatch(typeof(RoomController), nameof(RoomController.ThreadedWork))]
    [SuppressMessage("ReSharper", "InconsistentNaming")]
    // ReSharper disable once InconsistentNaming
    public class LogicStack_LogicStackTick
    {



        [UsedImplicitly]
        private static void Prefix()
        {
            try
            {
                RemoteControl.Log("Sending update");
                RemoteControl.Subscribers.SendUpdate();
            }
            catch (Exception e)
            {
                RemoteControl.Log($"prefix: Exception {e}:\n {e.StackTrace}");
            }
        }
    }
    
    
}