Package soc.qase.state

Examples of soc.qase.state.Entity


    try
    {
      while(true)
      {
        entity = new Entity();
        bitmask = processBitmask();
        entity.setNumber(processNumber());

        if(entity.getNumber() == 0)
          break;
View Full Code Here


/*-------------------------------------------------------------------*/
  public ServerSpawnBaseline(byte[] data, int off)
  {
    offset = off;
    this.data = data;
    entity = new Entity();

    bitmask = processBitmask();

    entity.setNumber(processNumber());
    entity.setActive(processActive());
View Full Code Here

  protected void preMatLab(World world, Object[] mlParams)
  {
    setAction(Action.ATTACK, false);

    // get the nearest item of any kind
    Entity nearestItem = getNearestItem(null, null);

    if(nearestItem != null)
    {
      pos.set(getPosition());
      itemPos.set(nearestItem.getOrigin());
    }

  /* -------PARAMATERS FOR MATLAB------- */
    matLabParams[0] = pos.toArray();
    matLabParams[1] = itemPos.toArray();
View Full Code Here

  protected void preMatLab(World world, Object[] mlParams)
  {
    setAction(Action.ATTACK, false);

    // get the nearest item of any kind
    Entity nearestItem = getNearestItem(null, null);

    if(nearestItem != null)
    {
      pos.set(getPosition());
      itemPos.set(nearestItem.getOrigin());
    }

  /* -------PARAMATERS FOR MATLAB------- */
    mlParams[0] = pos.toArray();
    mlParams[1] = itemPos.toArray();
View Full Code Here

*  from the gamestate.
@return nearest entity */
/*-------------------------------------------------------------------*/
  protected Entity getNearestEntity(Vector filteredEntities)
  {
    Entity tempEntity = null;
    Entity nearestEntity = null;

    Origin currentPos = getPosition();

    float tempDistance = 0;
    float distance = Float.MAX_VALUE;
View Full Code Here

@return the closest Waypoint to the nearest enemy player
@see soc.qase.state.Entity */
/*-------------------------------------------------------------------*/
  protected Waypoint findClosestOpponent()
  {
    Entity nearestOpponent = getNearestOpponent();

    if(wpMap == null || nearestOpponent == null)
      return null;

    return wpMap.findClosestWaypoint(nearestOpponent.getOrigin());
  }
View Full Code Here

@return a Waypoint array indicating the shortest path
@see soc.qase.state.Entity */
/*-------------------------------------------------------------------*/
  protected Waypoint[] findShortestPathToOpponent()
  {
    Entity nearestOpponent = getNearestOpponent();
    return (nearestOpponent == null ? null : findShortestPath(nearestOpponent.getOrigin()));
  }
View Full Code Here

  protected boolean isNearestOpponentVisible(boolean withinFOV)
  {
    if(!isBotAlive() || (!bsp.isMapLoaded() && !readMap()))
      return false;

    Entity nearestOpponent = getNearestOpponent();

    if(nearestOpponent != null)
    {
      oppPos.set(nearestOpponent.getOrigin());
      dir.sub(oppPos, pos);

      if(traceFromView) pos.add(proxy.getWorld().getPlayer().getPlayerView().getViewOffset());
      return (withinFOV ? Utils.calcAngles(dir)[0] <= proxy.getWorld().getPlayer().getPlayerView().getFOV() / 2.0 && bsp.isVisible(pos, oppPos) : bsp.isVisible(pos, oppPos));
    }
View Full Code Here

  public void runAI(World world)
  {
    setAction(Action.ATTACK, false);

    // get the nearest item of any kind
    Entity nearestItem = getNearestItem(null, null);

    if(nearestItem != null)
    {
      pos.set(getPosition());
      itemPos.set(nearestItem.getOrigin());

      itemDir.sub(itemPos, pos);
      setBotMovement(itemDir, null, 200, PlayerMove.POSTURE_NORMAL);
    }
  }
View Full Code Here

  public void runAI(World world)
  {
    setAction(Action.ATTACK, false);

    // get the nearest item of any kind
    Entity nearestItem = getNearestItem(null, null);

    if(nearestItem != null)
    {
      pos.set(getPosition());
      itemPos.set(nearestItem.getOrigin());

      itemDir.sub(itemPos, pos);
      setBotMovement(itemDir, null, 200, PlayerMove.POSTURE_NORMAL);
    }
  }
View Full Code Here

TOP

Related Classes of soc.qase.state.Entity

Copyright © 2018 www.massapicom. 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.