feat: move type bind and export impl function
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/// <reference types="@ms/types/dist/typings/sponge" />
|
||||
|
||||
import { server, plugin, command, event, task } from '@ms/api'
|
||||
import { DefaultContainer as container } from '@ms/container'
|
||||
import { server, command, event, task } from '@ms/api'
|
||||
import { Container } from '@ms/container'
|
||||
|
||||
import { SpongeConsole } from './console';
|
||||
import { SpongeEvent } from './event';
|
||||
@ -9,13 +9,10 @@ import { SpongeServer } from './server';
|
||||
import { SpongeCommand } from './command';
|
||||
import { SpongeTaskManager } from './task';
|
||||
|
||||
let SpongeServerType = 'sponge';
|
||||
let Sponge = Java.type("org.spongepowered.api.Sponge");
|
||||
|
||||
container.bind(server.Console).toConstantValue(SpongeConsole);
|
||||
container.bind(server.ServerType).toConstantValue(SpongeServerType);
|
||||
|
||||
container.bind(event.Event).to(SpongeEvent).inSingletonScope();
|
||||
container.bind(server.Server).to(SpongeServer).inSingletonScope();
|
||||
container.bind(command.Command).to(SpongeCommand).inSingletonScope();
|
||||
container.bind(task.TaskManager).to(SpongeTaskManager).inSingletonScope();
|
||||
export default function SpongeImpl(container: Container) {
|
||||
container.bind(server.Console).toConstantValue(SpongeConsole);
|
||||
container.bind(event.Event).to(SpongeEvent).inSingletonScope();
|
||||
container.bind(server.Server).to(SpongeServer).inSingletonScope();
|
||||
container.bind(command.Command).to(SpongeCommand).inSingletonScope();
|
||||
container.bind(task.TaskManager).to(SpongeTaskManager).inSingletonScope();
|
||||
}
|
||||
|
Reference in New Issue
Block a user