Skip to content

Commit

Permalink
[skip CI] CI/CD: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 27, 2024
1 parent e10fe5d commit 24f5fa8
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 246 deletions.
8 changes: 4 additions & 4 deletions Fuyu.Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ static async Task Main()
eftMainServer.RegisterServices();
eftMainServer.Start();

await ModManager.Instance.Load(container);
Terminal.WaitForInput();
await ModManager.Instance.UnloadAll();
}
await ModManager.Instance.Load(container);
Terminal.WaitForInput();
await ModManager.Instance.UnloadAll();
}
}
}
20 changes: 10 additions & 10 deletions Fuyu.DependencyInjection/DependencyContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ public T Resolve<T>(string id) where T : class
return (T)Resolve(id, typeof(T));
}

/// <summary>
/// Used to resolve an object of the desired type and id
/// </summary>
public T Resolve<TBase, T>(string id) where T : class
where TBase : class
{
return (T)Resolve(id, typeof(TBase));
}

#endregion
/// <summary>
/// Used to resolve an object of the desired type and id
/// </summary>
public T Resolve<TBase, T>(string id) where T : class
where TBase : class
{
return (T)Resolve(id, typeof(TBase));
}

#endregion

#region ResolveAll

Expand Down
14 changes: 7 additions & 7 deletions Fuyu.Modding/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Fuyu.Modding
{
public static class Extensions
{
public static T ResolveMod<T>(this DependencyContainer container, string id) where T: Mod
{
return container.Resolve<Mod, T>(id);
}
}
public static class Extensions
{
public static T ResolveMod<T>(this DependencyContainer container, string id) where T : Mod
{
return container.Resolve<Mod, T>(id);
}
}
}
58 changes: 29 additions & 29 deletions Fuyu.Modding/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@

namespace Fuyu.Modding
{
public abstract class Mod
{
internal bool IsLoaded { get; set; }
public abstract class Mod
{
internal bool IsLoaded { get; set; }

/// <summary>
/// Your plugin will be automatically registered into this dependency container with this ID.
/// </summary>
public abstract string Id { get; }
/// <summary>
/// Your plugin will be automatically registered into this dependency container with this ID.
/// </summary>
public abstract string Id { get; }

/// <summary>
/// This is the name that will be used in logs.
/// </summary>
public abstract string Name { get; }
/// <summary>
/// This is the name that will be used in logs.
/// </summary>
public abstract string Name { get; }

// TODO: Load dependencies first
public virtual string[] Dependencies { get; }
// TODO: Load dependencies first
public virtual string[] Dependencies { get; }

/// <summary>
/// Gets called after the server has set up everything.
/// </summary>
/// <param name="container"></param>
public virtual Task OnLoad(DependencyContainer container)
{
return Task.CompletedTask;
}
/// <summary>
/// Gets called after the server has set up everything.
/// </summary>
/// <param name="container"></param>
public virtual Task OnLoad(DependencyContainer container)
{
return Task.CompletedTask;
}

/// <summary>
/// Gets called whenever the server shuts down
/// </summary>
public virtual Task OnShutdown()
{
return Task.CompletedTask;
}
}
/// <summary>
/// Gets called whenever the server shuts down
/// </summary>
public virtual Task OnShutdown()
{
return Task.CompletedTask;
}
}
}
Loading

0 comments on commit 24f5fa8

Please sign in to comment.