private static void AskTransformBarricade(byte x, byte y, ushort plant, uint instanceID) { ThreadUtil.assertIsGameThread(); if (!BarricadeManager.tryGetRegion(x, y, plant, out var region)) { return; } var index = region.barricades.FindIndex(k => k.instanceID == instanceID); var data = region.barricades[index]; var drop = region.drops[index]; OnBarricadeTransformed?.Invoke(data, drop); }
private static void TellTransformBarricade(BarricadeManager __instance, CSteamID steamID, byte x, byte y, ushort plant, uint instanceID) { ThreadUtil.assertIsGameThread(); if (!__instance.channel.checkServer(steamID) || !BarricadeManager.tryGetRegion(x, y, plant, out var region)) { return; } var index = region.barricades.FindIndex(k => k.instanceID == instanceID); if (index < 0) { return; } var data = region.barricades[index]; var drop = region.drops[index]; OnBarricadeTransformed?.Invoke(data, drop, CurrentTransformingPlayerId); }