ontology.sprites.npc

## Class Chaser

- java.lang.Object
- - core.VGDLSprite
  - - ontology.sprites.npc.RandomNPC
    - - ontology.sprites.npc.Chaser

- Direct Known Subclasses:
    Fleeing

      public class Chaser
      extends RandomNPC

  Created with IntelliJ IDEA. User: Diego Date: 21/10/13 Time: 18:14 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `fleeing`
    `int` | `itype`
    `java.lang.String` | `stype`

    - ### Fields inherited from class core.VGDLSprite

      `bucket, bucketSharp, color, cooldown, draw_arrow, image, img, invisible, is_avatar, is_from_avatar, is_npc, is_oriented, is_resource, is_static, is_stochastic, itypes, lastmove, lastrect, mass, name, only_active, orientation, physics, physicstype, physicstype_id, portal, rect, resources, shrinkfactor, singleton, speed, spriteID, strength`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Chaser()`
    `Chaser(Vector2d position, java.awt.Dimension size, SpriteContent cnt)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `closestTargets(Game game)` Sets a list with the closest targets (sprites with the type 'stype'), by distance
    `VGDLSprite` | `copy()` Creates a copy of this sprite.
    `void` | `copyTo(VGDLSprite target)` Copies the attributes of this object to the one passed as parameter.
    `protected void` | `loadDefaults()` Loads the default values for this sprite.
    `protected void` | `movesToward(VGDLSprite target)`
    `void` | `postProcess()` Method to perform post processing when the sprite has received its parameters.
    `void` | `update(Game game)` Updates this sprite, performing the movements and actions for the next step.

    - ### Methods inherited from class core.VGDLSprite

      `_draw, _drawImage, _drawOriented, _drawResources, _updatePos, _velocity, applyMovement, draw, getAmountResource, getPosition, getType, init, lastDirection, loadImage, modifyResource, parseParameters, setFromAvatar, setRect, setRect, toString, updatePassive`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### fleeing

          public boolean fleeing

    - #### stype

          public java.lang.String stype

    - #### itype

          public int itype

  - ### Constructor Detail

    - #### Chaser

          public Chaser()

    - #### Chaser

          public Chaser(Vector2d position,
                java.awt.Dimension size,
                SpriteContent cnt)

  - ### Method Detail

    - #### loadDefaults

          protected void loadDefaults()

      Description copied from class: `VGDLSprite`
      Loads the default values for this sprite.
      Overrides:
        `loadDefaults` in class `RandomNPC`

    - #### postProcess

          public void postProcess()

      Description copied from class: `VGDLSprite`
      Method to perform post processing when the sprite has received its parameters.
      Overrides:
        `postProcess` in class `VGDLSprite`

    - #### update

          public void update(Game game)

      Description copied from class: `VGDLSprite`
      Updates this sprite, performing the movements and actions for the next step.
      Overrides:
        `update` in class `RandomNPC`
      Parameters:
        `game` - the current game that is being played.

    - #### movesToward

          protected void movesToward(VGDLSprite target)

    - #### closestTargets

          protected void closestTargets(Game game)

      Sets a list with the closest targets (sprites with the type 'stype'), by distance
      Parameters:
        `game` - game to access all sprites

    - #### copy

          public VGDLSprite copy()

      Description copied from class: `VGDLSprite`
      Creates a copy of this sprite. To be overwritten in each subclass.
      Overrides:
        `copy` in class `RandomNPC`
      Returns:
        a copy of this sprite.

    - #### copyTo

          public void copyTo(VGDLSprite target)

      Description copied from class: `VGDLSprite`
      Copies the attributes of this object to the one passed as parameter.
      Overrides:
        `copyTo` in class `RandomNPC`
      Parameters:
        `target` - the sprite to copy to.