Examples of Behaviour


Examples of fr.soleil.salsa.entity.Behaviour

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

Examples of fr.soleil.salsa.entity.Behaviour

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

Examples of fr.soleil.salsa.entity.Behaviour

                    setAttribute("enableScanSpeed", enableScanSpeed);

                    // Post scan behaviour.
                    IPostScanBehaviour postScanBehaviour = config.getScanAddOn()
                            .getPostScanBehaviour();
                    Behaviour behaviour = postScanBehaviour.getBehaviour();
                    if (behaviour == null) {
                        behaviour = Behaviour.NOOP;
                    }
                    int behaviourType = behaviour.getType();
                    setAttribute("afterRunActionType", behaviourType);
                    if (behaviour.getArgumentCount() >= 1) {
                        int behaviourSensorIndex = postScanBehaviour.getSensor();
                        setAttribute("afterRunActionSensor", behaviourSensorIndex);
                    }
                    else if (behaviour.getArgumentCount() >= 2) {
                        int behaviourActuatorIndex = postScanBehaviour.getActuator();
                        setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                    }

                    // Error strategies.
View Full Code Here

Examples of fr.soleil.salsa.entity.Behaviour

        // }
    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        Behaviour b = Behaviour.valueOf(Behaviour.class, code);
        if (config.getScanAddOn().getPostScanBehaviour() == null) {
            config.getScanAddOn().setPostScanBehaviour(new PostScanBehaviourModel());
        }
        config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
    }
View Full Code Here

Examples of fr.soleil.salsa.entity.Behaviour

            view.setZigzag(config.isZigzag());
            view.setOnTheFly(config.isOnTheFly());
            view.setEnableActuatorSpeed(config.isEnableScanSpeed());

            // Behaviour
            Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
            int selectedIndex = 0;

            view.clearPostScanBehaviour();
            Behaviour[] behaviours = Behaviour.values();
            for (int i = 0; i < behaviours.length; i++) {
                Behaviour b = behaviours[i];
                view.addPostScanBehaviour(b.name(), b.getShortDescription());
                if (selectedBehaviour == b) {
                    selectedIndex = i;
                    view.setDescription(b.getLongDescription());
                }
            }
            view.setPostScanSelected(selectedIndex);

            // We enable or not the sensor and actuator combo box.
View Full Code Here

Examples of fr.soleil.salsa.entity.Behaviour

    public ScanFunctionsController() {
        view = new ScanFunctionsView(this);
       
        Behaviour[] behavioursValues = Behaviour.values();
        Option[] behavioursArray = new Option[behavioursValues.length];
        Behaviour behaviour;
        for(int behaviourIndex = 0; behaviourIndex < behavioursValues.length; ++behaviourIndex) {
            behaviour = behavioursValues[behaviourIndex];
            behavioursArray[behaviourIndex] = new Option(behaviour, behaviour.getShortDescription());
        }
        view.setFunctionsArray(behavioursArray);
       
        updater = new ScanFunctionsUpdater();
        PeriodicRefreshUpdater.getInstance().add(updater);
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.impl.Behaviour

            + "' and at most #'stake " + MAX_STAKE
            + "' pieces of gold. So, how much will you risk?", null);

    ramon.add(ConversationStates.ATTENDING, "stake", null,
        ConversationStates.ATTENDING, null,
        new BehaviourAction(new Behaviour(), "stake", "offer") {
          @Override
          public void fireSentenceError(Player player, Sentence sentence, EventRaiser npc) {
                npc.say(sentence.getErrorString() + " Just tell me how much you want to risk, for example #'stake 50'.");
          }
View Full Code Here

Examples of games.stendhal.server.entity.npc.behaviour.impl.Behaviour

        addHelp("You can't get into the imperial city of Sedah without a key.");
        addQuest("The only favour I need is cold hard cash.");
        addOffer("Only a #bribe could persuade me to hand over the key to that gate.");

        addReply("bribe", null,
          new BehaviourAction(new Behaviour("money"), "bribe", "offer") {
            @Override
            public void fireSentenceError(Player player, Sentence sentence, EventRaiser raiser) {
              raiser.say(sentence.getErrorString() + " Are you trying to trick me? Bribe me some number of coins!");
            }
View Full Code Here

Examples of jade.core.behaviours.Behaviour

       for(Iterator it = new EnumIterator(readyBehaviours.elements()); it.hasNext();)
       #MIDP_INCLUDE_END*/
      behaviours[counter++] = (Behaviour)it.next();
   
    for(int i = 0; i < behaviours.length; i++) {
      Behaviour b = behaviours[i];
      b.restart();
    }
   
    behaviours = new Behaviour[blockedBehaviours.size()];
    counter = 0;
    //#MIDP_EXCLUDE_BEGIN
    for(Iterator it = blockedBehaviours.iterator(); it.hasNext();) {
      //#MIDP_EXCLUDE_END
      /*#MIDP_INCLUDE_BEGIN
       for(Iterator it = new EnumIterator(blockedBehaviours.elements()); it.hasNext();) {
       #MIDP_INCLUDE_END*/
     
      //#DOTNET_EXCLUDE_BEGIN
      behaviours[counter++] = (Behaviour)it.next();
      //#DOTNET_EXCLUDE_END
      /*#DOTNET_INCLUDE_BEGIN
       Object tmpB = null;
       try // Hack: sometimes .NET inserts into this array a non-Behaviour object
       {
       tmpB = it.next();
       behaviours[counter++] = (Behaviour)tmpB;
       }
       catch(ClassCastException cce)
       {
       System.out.println("Found an object of type "+tmpB.getClass().getName()+" instead of Behaviour");
       cce.printStackTrace();
       }
       #DOTNET_INCLUDE_END*/
    }
   
    for(int i = 0; i < behaviours.length; i++) {
      Behaviour b = behaviours[i];
      /*#DOTNET_INCLUDE_BEGIN
       if (b != null)
       #DOTNET_INCLUDE_END*/
      b.restart();
     
    }
  }
 
View Full Code Here

Examples of net.sf.laja.parser.cdd.behaviour.Behaviour

    private DirectoryConverter directoryConverter = new DirectoryConverter();

    public Behaviour asBehaviour(StateTemplate template) {
        String packagename = asBehaviourPackage(template.rootStatePackage, template.packagename, template.rootBehaviourPackage);

        Behaviour behaviour = new Behaviour();
        behaviour.exists = false;
        behaviour.packagename = packagename;
        behaviour.sourceDir = directoryConverter.asDirectoryPath(template.rootSrcDir, packagename);
        behaviour.outputDir = directoryConverter.asDirectoryPath(template.rootOutDir, packagename);
        behaviour.srcFilename = behaviour.sourceDir + "/" + template.classname + ".java";
        behaviour.setClassname(template.classname);
        behaviour.setStateClass(template.classname + "State");
        behaviour.setParameters(new Parameters());

        AsMethod asMethod = new AsMethod();
        asMethod.setComment("(factory)");
        asMethod.setMethodName("as" + template.classname);
        asMethod.setReturnclass(template.classname);
        Statement statement = new Statement();
        statement.setInnerStatement("        return new " + behaviour.classname + "(state);");
        asMethod.setStatement(statement);
        asMethod.setParameters(new Parameters());
        behaviour.addAsMethod(asMethod);

        Imports imports = new Imports();
        Importstatement importstatement = new Importstatement();
        String fullclassname = template.packagename + "." + template.stateClass;
        importstatement.setFullclassname(fullclassname);
        importstatement.setStatement("import " + fullclassname + ";");
        imports.addImportstatement(importstatement);
        behaviour.setImports(imports);

        return behaviour;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.