Exemplo n.º 1
0
  /** Find objects that are in visibility range. */
  protected void findVisibleObjects() {
    if (owner == null || !owner.isSpawned()) {
      return;
    }

    MapRegion[] regions = owner.getActiveRegion().getNeighbours();
    for (int i = 0; i < regions.length; i++) {
      MapRegion r = regions[i];
      FastMap<Integer, VisibleObject> objects = r.getObjects();
      for (FastMap.Entry<Integer, VisibleObject> e = objects.head(), mapEnd = objects.tail();
          (e = e.getNext()) != mapEnd; ) {
        VisibleObject newObject = e.getValue();
        if (newObject == owner || newObject == null) {
          continue;
        }

        if (!isAwareOf(newObject)) {
          continue;
        }
        if (knownObjects.containsKey(newObject.getObjectId())) {
          continue;
        }

        if (!checkObjectInRange(newObject)
            && !newObject.getKnownList().checkReversedObjectInRange(owner)) {
          continue;
        }

        /** New object is not known. */
        if (add(newObject)) {
          newObject.getKnownList().add(owner);
        }
      }
    }
  }
Exemplo n.º 2
0
 public Object get() {
   FastMap localMap = getLocalMap();
   Object value = localMap.get(this);
   if ((value == null) && !(localMap.containsKey(this))) {
     value = initialValue();
     localMap.put(this, value);
   }
   return value;
 }
Exemplo n.º 3
0
 public boolean setExists(int chestId) {
   return _armorSets.containsKey(chestId);
 }
Exemplo n.º 4
0
 /**
  * Check if object is known
  *
  * @param object
  * @return true if object is known
  */
 public boolean knowns(AionObject object) {
   return knownObjects.containsKey(object.getObjectId());
 }
Exemplo n.º 5
0
  /**
   * @param cooldownId
   * @return
   */
  public long getSkillCoolDown(int cooldownId) {
    if (skillCoolDowns == null || !skillCoolDowns.containsKey(cooldownId)) return 0;

    return skillCoolDowns.get(cooldownId);
  }