Examples of Guard


Examples of com.github.mustachejava.reflect.Guard

    String source = "Test.java";
    CompilableClassGuard stringClassGuard = new CompilableClassGuard(0, "");
    List<CompilableGuard> guards = new ArrayList<CompilableGuard>();
    guards.add(stringClassGuard);

    Guard testGuard = compile(guards);
    assertTrue("string is ok", testGuard.apply(new Object[]{"test", 1}));
    assertFalse("integer is not ok", testGuard.apply(new Object[]{1, "test"}));
  }
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.Guard

  public DetachedRuleset handleDetachedRuleset(HiddenTokenAwareTree token) {
    return new DetachedRuleset(token, handleGeneralBody(token.getChild(0)));
  }

  public Guard handleGuard(HiddenTokenAwareTree token) {
    Guard result = new Guard(token);
    Iterator<HiddenTokenAwareTree> iterator = token.getChildren().iterator();
    result.addCondition(handleGuardCondition(iterator.next()));
    while (iterator.hasNext()) {
      validateGuardAnd(iterator.next());
      result.addCondition(handleGuardCondition(iterator.next()));
    }

    return result;
  }
View Full Code Here

Examples of com.werken.blissed.Guard

     */
    public void doTag(final XMLOutput output) throws Exception
    {
        Script script = getBody();
       
        Guard guard = new JellyGuard( script );

        if ( getVar() != null )
        {
            getContext().setVariable( getVar(),
                                      guard );
View Full Code Here

Examples of cz.cuni.mff.abacs.burglar.logics.objects.agents.Guard

              this._activateButton.setText(STR_ACTIVATE + " (" + Player.PENALTY_VENDER_ACTIVATED + ")");
              this._buttons.add(this._activateButton);
            }
            break;
          case GUARD:
            Guard guard = (Guard)object;
            if(guard.isInState(Guard.State.WELL)){
              this._buttons.add(this._dazeButton);
            }
          case BURGLAR:
            if(this._parent._player.getSelectedAgent() == (Agent)object){
              this._showIntentButton.setText(STR_HIDE_INTENT);
View Full Code Here

Examples of cz.cuni.mff.abacs.burglar.logics.objects.agents.Guard

      this._listener.planningFinished(result, this);
      break;
     
    case GUARD:
     
      Guard guard = (Guard)agent;
      result = this._planner.solveGuardProblem(
          guard,
          this._map,
          emptyList,
          emptyList
View Full Code Here

Examples of cz.cuni.mff.abacs.burglar.logics.objects.agents.Guard

        builder.append(STR_TAG_END__);
        builder.append(STR_TAG_END_);
     
        break;
      case GUARD:
        Guard guard = (Guard) agent;
        for(Integer room : guard.getAllGoalRooms()){
          generateInlineTag(
              builder,
              '\t' + STR_TAG_VISITED,
              generateObjectName(agent.getId()),
              generateObjectName(room)
          );
          if(guard.getRoomId() == room){
            generateInlineTag(
                builder,
                '\t' + STR_TAG_AGENT_IN,
                generateObjectName(agent.getId()),
                generateObjectName(room)
View Full Code Here

Examples of cz.cuni.mff.abacs.burglar.logics.objects.agents.Guard

        pathPositions.addAll(routePositionIds);
      }
    }
   
    // create the object
    Guard guard = new Guard(id, position, pathPositions, map);
   
    for(int i = 0; i < rawList.getLength(); i++){
      Node node = rawList.item(i);
     
      // fill the belief base object:
      ifnode.getNodeType() == Node.ELEMENT_NODE &&
        node.getNodeName().equals(STR_BELIEFBASE)
      ){
        Element mind = (Element)node;
        BeliefBase knowledge = guard.getBeliefBase();
        knowledge.seenFromNear(XMLLoader.getPositions(mind, map));
      }
     
      // fill the inventory:
      ifnode.getNodeType() == Node.ELEMENT_NODE &&
        node.getNodeName().equals(STR_INVENTORY)
      ){
        Element inventory = (Element)node;
        List<Item> items = XMLLoader.getItems(inventory, map);
        map.addItems(items);
        guard.addItems(items);
      }
    }
   
    // add the uniform:
    Uniform clothes = new Uniform(map.getNextID(), map);
    guard.addItem(clothes);
    map.addItem(clothes);
   
    if(isStunned)
      guard.daze();
   
    return guard;
  }
View Full Code Here

Examples of net.citizensnpcs.guards.Guard

        return !LocationUtils.withinRange(npc.getLocation(), npc.getBaseLocation(), 3.5);
    }

    private boolean findTarget(HumanNPC npc)
    {
        Guard guard = npc.getType("guard");
        if (!guard.isAggressive())
            return false;
        LivingEntity entity = Targeter.findTarget(Targeter.getNearby(npc.getPlayer(), guard.getProtectionRadius()), npc);
        if (entity != null && LocationUtils.withinRange(entity.getLocation(), npc.getBaseLocation(), guard.getProtectionRadius()))
        {
            if (entity.isDead())
            {
                return false;
            }
           
            guard.target(entity, npc);
            return true;
        }
        return false;
    }
View Full Code Here

Examples of net.citizensnpcs.guards.Guard

        }
        return false;
    }

    private boolean keepAttacking(HumanNPC npc) {
        Guard guard = npc.getType("guard");
        if (npc.getHandle().getStationaryTicks() > Settings.getInt("MaxStationaryReturnTicks")) {
            npc.teleport(npc.getBaseLocation());
            npc.getHandle().cancelTarget();
        }
        return npc.getHandle().hasTarget()
                && LocationUtils.withinRange(npc.getLocation(), npc.getBaseLocation(), guard.getProtectionRadius());
    }
View Full Code Here

Examples of net.citizensnpcs.guards.Guard

                && LocationUtils.withinRange(npc.getLocation(), npc.getBaseLocation(), guard.getProtectionRadius());
    }

    @Override
    public void onDamage(HumanNPC npc, LivingEntity attacker) {
        Guard guard = npc.getType("guard");
        guard.target(attacker, npc);
    }
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.