Skip to content

Commit 0e59a88

Browse files
committed
Add Compiler required interfaces
1 parent 55fc145 commit 0e59a88

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Oxide.CompilerServices
2+
{
3+
public interface ICompilation
4+
{
5+
6+
}
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using Oxide.Converters;
3+
4+
namespace Oxide.CompilerServices
5+
{
6+
public interface ICompilerService<T> : IDisposable
7+
{
8+
IConverter<ICompilation, T> Converter { get; }
9+
}
10+
}

src/Converters/IConverter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Oxide.Converters
2+
{
3+
public interface IConverter<T, T0>
4+
{
5+
T0 Convert(T input);
6+
}
7+
}

src/EnvironmentHelper.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@
22

33
namespace Oxide
44
{
5+
/// <summary>
6+
/// Helper methods for interacting with OxideMod specific environmental variables
7+
/// </summary>
58
public static class EnvironmentHelper
69
{
10+
/// <summary>
11+
/// Gets a OxideMod environmental variable
12+
/// </summary>
13+
/// <param name="key">The environmental variable</param>
14+
/// <returns></returns>
715
public static string GetVariable(string key) => Environment.GetEnvironmentVariable(NormalizeKey(key));
816

17+
/// <summary>
18+
/// Sets a OxideMod environmental variable for the process
19+
/// </summary>
20+
/// <param name="key"></param>
21+
/// <param name="value"></param>
22+
/// <param name="force"></param>
23+
/// <exception cref="InvalidOperationException"></exception>
924
public static void SetVariable(string key, string value, bool force = false)
1025
{
1126
key = NormalizeKey(key);

0 commit comments

Comments
 (0)