Decompiled source of Leos Weather Forecast API v1.0.0

lwfaeAPI.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using UnityEngine;
using loaforcsSoundAPI;
using loaforcsSoundAPI.SoundPacks.Data.Conditions;
using lwfaeAPI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("lwfaeAPI")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("Leos Weather Forecast and Extras API")]
[assembly: AssemblyTitle("lwfaeAPI")]
[assembly: AssemblyVersion("1.1.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace lwfaeAPI
{
	[BepInPlugin("LeosWeatherForecastandExtrasAPI", "lwfaeAPI", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			SoundAPI.RegisterAll(Assembly.GetExecutingAssembly());
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Leos Weather Forecast & Extras API Conditions loaded!");
		}
	}
}
namespace lwfAPI.Conditions
{
	[SoundAPICondition("lwfAPI:weather", false, null)]
	public class WeatherCondition : Condition
	{
		private static string lastLogged;

		public string Value { get; internal set; }

		public override bool Evaluate(IContext context)
		{
			if (!Object.op_Implicit((Object)(object)StartOfRound.Instance))
			{
				return false;
			}
			if (!Object.op_Implicit((Object)(object)StartOfRound.Instance.currentLevel))
			{
				return false;
			}
			string text = ((object)Unsafe.As<LevelWeatherType, LevelWeatherType>(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString();
			string text2 = StartOfRound.Instance.currentLevel.PlanetName + "|" + text;
			if (text2 != lastLogged)
			{
				lastLogged = text2;
				Plugin.Log.LogInfo((object)("Current weather: \"" + text + "\" (moon: " + StartOfRound.Instance.currentLevel.PlanetName + ")"));
			}
			return string.Equals(Value, text, StringComparison.InvariantCultureIgnoreCase);
		}
	}
}