Exemplo n.º 1
0
#pragma warning disable IDE0051 // Remover membros privados não utilizados
        private static void OnNodeChanged(ref ushort node)
        {
            ushort node_ = node;

            SimulationManager.instance.AddAction(() => EventNodeChanged?.Invoke(node_)).Execute();

            WTSBuildingDataCaches.PurgeStopCache(node);
        }
        public static void BeforeRemoveStop(ref TransportLine __instance, int index, ushort lineID)
        {
            if ((__instance.m_flags & TransportLine.Flags.Temporary) != TransportLine.Flags.None || __instance.m_stops > NetManager.MAX_NODE_COUNT)
            {
                return;
            }
            ushort num;

            if (index == -1)
            {
                index += __instance.CountStops(lineID);
            }
            num = __instance.m_stops;
            for (int i = 0; i < index && num <= NetManager.MAX_NODE_COUNT; i++)
            {
                num = TransportLine.GetNextStop(num);
                if (num == __instance.m_stops)
                {
                    break;
                }
            }
            WTSBuildingDataCaches.PurgeStopCache(num);
        }