use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.
the class EnvironmentSwitchHandler method registerComponents.
private static void registerComponents(ComponentLibrary library, ModuleEnvironment environment) {
for (Class<? extends Component> componentType : environment.getSubtypesOf(Component.class)) {
if (componentType.getAnnotation(DoNotAutoRegister.class) == null) {
String componentName = MetadataUtil.getComponentClassName(componentType);
library.register(new SimpleUri(environment.getModuleProviding(componentType), componentName), componentType);
}
}
}
use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.
the class BindCommands method dvorak.
@Command(shortDescription = "Switches to typical keybinds for DVORAK", requiredPermission = PermissionManager.NO_PERMISSION)
public String dvorak() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.COMMA, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.A, new SimpleUri("engine:left"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.O, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.E, new SimpleUri("engine:right"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.C, new SimpleUri("engine:inventory"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.PERIOD, new SimpleUri("engine:useItem"));
return "Changed key bindings to DVORAK keyboard layout.";
}
use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.
the class BindCommands method neo.
@Command(shortDescription = "Switches to typical key binds for NEO 2 keyboard layout", requiredPermission = PermissionManager.NO_PERMISSION)
public String neo() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.V, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.I, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.U, new SimpleUri("engine:left"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.A, new SimpleUri("engine:right"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.L, new SimpleUri("engine:useItem"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.G, new SimpleUri("engine:inventory"));
return "Changed key bindings to NEO 2 keyboard layout.";
}
use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.
the class BindCommands method azerty.
@Command(shortDescription = "Switches to typical key binds for AZERTY", requiredPermission = PermissionManager.NO_PERMISSION)
public String azerty() {
bindsManager.linkBindButtonToKey(Keyboard.KeyId.Z, new SimpleUri("engine:forwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.S, new SimpleUri("engine:backwards"));
bindsManager.linkBindButtonToKey(Keyboard.KeyId.Q, new SimpleUri("engine:left"));
return "Changed key bindings to AZERTY keyboard layout.";
}
use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.
the class ComponentSerializerTest method setup.
@Before
public void setup() {
context = new ContextImpl();
context.put(ModuleManager.class, moduleManager);
CoreRegistry.setContext(context);
TypeSerializationLibrary serializationLibrary = new TypeSerializationLibrary(reflectFactory, copyStrategyLibrary);
serializationLibrary.add(Vector3f.class, new Vector3fTypeHandler());
serializationLibrary.add(Quat4f.class, new Quat4fTypeHandler());
NetworkSystem networkSystem = mock(NetworkSystem.class);
context.put(NetworkSystem.class, networkSystem);
EntitySystemSetupUtil.addReflectionBasedLibraries(context);
EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
EngineEntityManager entityManager = context.get(EngineEntityManager.class);
entityManager.getComponentLibrary().register(new SimpleUri("test", "gettersetter"), GetterSetterComponent.class);
entityManager.getComponentLibrary().register(new SimpleUri("test", "string"), StringComponent.class);
entityManager.getComponentLibrary().register(new SimpleUri("test", "integer"), IntegerComponent.class);
ComponentLibrary componentLibrary = entityManager.getComponentLibrary();
componentSerializer = new ComponentSerializer(componentLibrary, serializationLibrary);
}
Aggregations