projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/xtext/GameStandaloneSetupGenerated.java
2021-12-03 08:36:23 +01:00

43 lines
1.4 KiB
Java

/*
* generated by Xtext 2.23.0
*/
package xtext;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.common.TerminalsStandaloneSetup;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.IResourceServiceProvider;
import xtext.game.GamePackage;
@SuppressWarnings("all")
public class GameStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
TerminalsStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public Injector createInjector() {
return Guice.createInjector(new GameRuntimeModule());
}
public void register(Injector injector) {
if (!EPackage.Registry.INSTANCE.containsKey("http://game")) {
EPackage.Registry.INSTANCE.put("http://game", GamePackage.eINSTANCE);
}
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("game", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("game", serviceProvider);
}
}