Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objectBuilder"></param>
        public static void registerElement(IObjectBuilder objectBuilder, IInputManager inputManager, Core core)
        {
            ParameterSequenceBuilder sequenceBuilder = new ParameterSequenceBuilder();
            sequenceBuilder.createSequence();

            sequenceBuilder.addParameter(new BoolParameter("lastKey","false"));
            sequenceBuilder.addParameter(new BoolParameter("lastMouse", "false"));
            sequenceBuilder.addParameter(new BoolParameter("lastTouch", "false"));
            sequenceBuilder.addParameter(new BoolParameter("lastGamepad", "false"));
            sequenceBuilder.addParameter(new StringParameter("playerIndex","One"));

            CompoundParameter keymapping = new CompoundParameter("keymapping");
            keymapping.addParameter(new StringParameter("key",""));
            keymapping.addParameter(new BoolParameter("pressed", "false"));
            keymapping.addParameter(new IdParameter("downMsgId", ""));
            keymapping.addParameter(new IdParameter("upMsgId", ""));
            keymapping.addParameter(new IdParameter("target",""));
            keymapping.addParameter(new StringParameter("message", ""));
            SequenceParameter keymappings = new SequenceParameter("keymappings", keymapping);

            CompoundParameter keyboardMappings = new CompoundParameter("keyboard");
            keyboardMappings.addParameter(keymappings);
            sequenceBuilder.addParameter(keyboardMappings);

            CompoundParameter gamepadmapping = new CompoundParameter("gamepadmapping");
            gamepadmapping.addParameter(new StringParameter("key", "Start"));
            gamepadmapping.addParameter(new BoolParameter("pressed", "false"));
            gamepadmapping.addParameter(new IdParameter("downMsgId", ""));
            gamepadmapping.addParameter(new IdParameter("upMsgId", ""));
            gamepadmapping.addParameter(new IdParameter("target", ""));
            gamepadmapping.addParameter(new StringParameter("message", ""));
            SequenceParameter gamepadmappings = new SequenceParameter("gamepadmappings", gamepadmapping);

            //CompoundParameter gamepadLeftStickMapping = new CompoundParameter("leftStickMapping");
            //gamepadLeftStickMapping.addParameter(new IdParameter("movedMsgId",""));
            //gamepadLeftStickMapping.addParameter(new IdParameter("target", ""));

            //CompoundParameter gamepadRightStickMapping = new CompoundParameter("rightStickMapping");
            //gamepadRightStickMapping.addParameter(new IdParameter("movedMsgId", ""));
            //gamepadRightStickMapping.addParameter(new IdParameter("target", ""));

            CompoundParameter gamepadMappings = new CompoundParameter("gamepad");
            gamepadMappings.addParameter(gamepadmappings);
            //gamepadMappings.addParameter(gamepadLeftStickMapping);
            //gamepadMappings.addParameter(gamepadRightStickMapping);
            sequenceBuilder.addParameter(gamepadMappings);

            objectBuilder.registerElement(new Constructor(inputManager, core), sequenceBuilder.CurrentSequence, typeof(InputContext), "InputContext", null);
        }
Exemplo n.º 2
0
 protected static void basicRegistration(ParameterSequenceBuilder sequenceBuilder)
 {
     sequenceBuilder.addParameter(new IdParameter("collisionGroup",CollisionManager.CollideAllId.ToString()));
     SequenceParameter collisionGroups = new SequenceParameter("collisionGroups", new IdParameter("collisionGroup", CollisionManager.CollideAllId.ToString()));
     sequenceBuilder.addParameter(collisionGroups);
     sequenceBuilder.addParameter(new FloatParameter("position","0.0,0.0,0.0"));
 }