Examples of Guard


Examples of net.citizensnpcs.guards.Guard

        toRespawn.put(npc.getOwner(), new NPCLocation(npc.getLocation(), npc.getUID(), npc.getOwner()));
        NPCManager.despawn(npc.getUID(), NPCRemoveReason.DEATH);
    }

    private boolean findTarget(HumanNPC npc) {
        Guard guard = npc.getType("guard");
        Player player = Bukkit.getPlayerExact(npc.getOwner());
        if (player == null) {
            despawn(npc);
            return false;
        }
        double range = Settings.getDouble("PathfindingRange");
        if (guard.isAggressive()
                && LocationUtils.withinRange(npc.getLocation(), player.getLocation(), guard.getProtectionRadius())) {
            LivingEntity entity = Targeter.findTarget(Targeter.getNearby(player, guard.getProtectionRadius()), npc);
            if (entity != null && !entity.isDead()) {
                guard.target(entity, npc);
                return true;
            } else if (npc.getHandle().getTarget() != player) {
                PathUtils.target(npc, player, false, -1, -1, range);
            }
        } else {
View Full Code Here

Examples of net.citizensnpcs.guards.Guard

        Player owner = Bukkit.getPlayerExact(npc.getOwner());
        if (owner == null) {
            despawn(npc);
            return false;
        }
        Guard guard = npc.getType("guard");
        return npc.getHandle().hasTarget()
                && LocationUtils.withinRange(owner.getLocation(), npc.getLocation(), guard.getProtectionRadius());
    }
View Full Code Here

Examples of org.beangle.ems.web.tags.component.Guard

  public TagModel getGuard() {
    TagModel model = models.get(Guard.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Guard(stack, authorityManager);
        }
      };
      models.put(Guard.class, model);
    }
    return model;
View Full Code Here

Examples of org.beangle.ems.web.tags.component.Guard

  public TagModel getGuard() {
    TagModel model = models.get(Guard.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Guard(stack, authorityManager);
        }
      };
      models.put(Guard.class, model);
    }
    return model;
View Full Code Here

Examples of org.neo4j.kernel.guard.Guard

            HttpServletRequest request = (HttpServletRequest) req;
            HttpServletResponse response = (HttpServletResponse) res;

            int timeLimit = getTimeLimit(request);
            if (timeLimit > 0) {
                Guard guard = getGuard(req);
                if (guard != null) {
                    //guard.startTimeout(timeLimit);
                    guard.startOperationsCount(maxOps);
                    try {
                        chain.doFilter(req, res);
                        return;
                    } catch (GuardException e) {
                        LOG.warn("Aborting Request "+dump(request));
                        response.setStatus(SC_REQUEST_TIMEOUT);
                        rollback(req);
                    } finally {
                        guard.stop();
                    }
                }
            }
        }
        chain.doFilter(req, res);
View Full Code Here

Examples of org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.Instructions.Guard

  public CodeBlock EXHAUST() {
    return add(new Exhaust(this));
  }
 
  public CodeBlock GUARD() {
    return add(new Guard(this));
  }
View Full Code Here

Examples of org.reactfx.Guard

        private final BooleanProperty b = new SimpleBooleanProperty();
        private final BooleanBinding output = BooleanBinding.wrap(a.and(b));

        @Override
        public void setInputs(boolean a, boolean b) {
            Guard guard = output.block();
            this.a.set(a);
            this.b.set(b);
            guard.close();
        }
View Full Code Here

Examples of org.reactfx.Guard

        eagerTest.run();
        long t2 = System.currentTimeMillis();
        double eagerTime = (t2-t1)/1000.0;

        t1 = System.currentTimeMillis();
        Guard g = lazyResult.block();
        lazyTest.run();
        g.close();
        t2 = System.currentTimeMillis();
        double lazyTime = (t2-t1)/1000.0;

        System.out.println("EAGER TEST:");
        System.out.println("    fib_" + n + " = " + eagerResult.get());
View Full Code Here

Examples of org.reactfx.Guard

        source.setValue(true);
        source.setValue(false);
        assertEquals(2, counter.getAndReset());

        Guard g = tested.block();
        source.setValue(true);
        source.setValue(false);
        g.close();
        assertEquals(1, counter.get());
    }
View Full Code Here

Examples of org.restlet.Guard

        MethodBasedRouter router = getMethodRouter(endpoint.getUriPattern());
       
        Map<String, String> realm = endpoint.getRealm();
        Restlet target = consumer.getRestlet();
        if (realm != null && realm.size() > 0) {
            Guard guard = new Guard(component.getContext().createChildContext(),
                    ChallengeScheme.HTTP_BASIC, "Camel-Restlet Endpoint Realm");
            for (Map.Entry<String, String> entry : realm.entrySet()) {
                guard.getSecrets().put(entry.getKey(), entry.getValue().toCharArray());
            }
            guard.setNext(target);
            target = guard;
            if (LOG.isDebugEnabled()) {
                LOG.debug("Target has been set to guard: " + guard);
            }
        }
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.