-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainInstaller.cs
More file actions
22 lines (20 loc) · 832 Bytes
/
MainInstaller.cs
File metadata and controls
22 lines (20 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using ComputerInterface;
using ComputerInterface.Interfaces;
using Zenject;
namespace ComputerModExample
{
internal class MainInstaller : Installer
{
public override void InstallBindings()
{
// Bind your mod entry like this
Container.Bind<IComputerModEntry>().To<MyModEntry>().AsSingle();
// I just bind another class here to demonstrate adding a command
// of course you can request the CommandHandler in any of your types as long as you bind it
// notice how I use BindInterfacesAndSelfTo
// since MyModCommandManager inherits the IInitializable interface
// the class gets instantiated even if no other class needs it
Container.BindInterfacesAndSelfTo<MyModCommandManager>().AsSingle();
}
}
}