## edu.cwru.SimpleRTS.model
Class SimplePlanner

    java.lang.Object
      edu.cwru.SimpleRTS.model.SimplePlanner

All Implemented Interfaces:
  java.io.Serializable

    public class SimplePlanner

extends java.lang.Object
implements java.io.Serializable

An implementation of basic planning methods

Author:
  Scott, Tim
See Also:
  Serialized Form

Constructor Summary
`SimplePlanner(State state)`

Method Summary
`static java.util.LinkedList<Direction>` `getDirections(State.StateView state, int startingx, int startingy, int endingx, int endingy, int tolerancedistance, boolean cancollideonfinal)` Uses A* to calculate the directions to arrive at the specified location.
`java.util.LinkedList<Action>` `planAttack(int actor, int target)`
`java.util.LinkedList<Action>` `planAttack(Unit actor, Unit target)` Uses `#getDirections(StateView, int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to follow them.
`java.util.LinkedList<Action>` `planBuild(int actor, int targetX, int targetY, int template)`
`java.util.LinkedList<Action>` `planBuild(Unit actor, int targetX, int targetY, UnitTemplate template)`
`java.util.LinkedList<Action>` `planDeposit(int actor, int target)`
`java.util.LinkedList<Action>` `planDeposit(Unit actor, Unit target)` Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to move almost there.
`java.util.LinkedList<Action>` `planFail(int actor)`
`java.util.LinkedList<Action>` `planGather(int actor, int target)`
`java.util.LinkedList<Action>` `planGather(Unit actor, ResourceNode target)` Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to move almost there.
`java.util.LinkedList<Action>` `planMove(int i, int x, int y)`
`java.util.LinkedList<Action>` `planMove(Unit actor, int x, int y)` Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to follow them.
`java.util.LinkedList<Action>` `planPermanentFail(int actor)`
`java.util.LinkedList<Action>` `planProduce(int actor, int template)`
`java.util.LinkedList<Action>` `planProduce(Unit actor, Template template)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimplePlanner

    public SimplePlanner(State state)

Method Detail

### getDirections

    public static java.util.LinkedList<Direction> getDirections(State.StateView state,
                                                                int startingx,
                                                                int startingy,
                                                                int endingx,
                                                                int endingy,
                                                                int tolerancedistance,
                                                                boolean cancollideonfinal)

  Uses A* to calculate the directions to arrive at the specified location. If there is no path, it returns null (it does not do a best effort) When you wish upon A* ...

  Parameters:
    `startingx` -
    `startingy` -
    `endingx` -
    `endingy` -
    `tolerancedistance` - The distance at which to stop trying to seek (IE, 0 is on top of it, 1 is next to it, etc) Note that the distance should count diagonals as 1 dist
    `cancollideonfinal` - Whether or not to allow a collision on the final move (allowing it to be used for gathering by telling it the last direction)
  Returns:
    Some primitive (IE, based on directions) moves that bring you within distance of the ending x and y

### planMove

    public java.util.LinkedList<Action> planMove(Unit actor,
                                                 int x,
                                                 int y)

  Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to follow them.

  Parameters:
    `actor` -
    `x` -
    `y` -
  Returns:

### planFail

    public java.util.LinkedList<Action> planFail(int actor)

### planPermanentFail

    public java.util.LinkedList<Action> planPermanentFail(int actor)

### planMove

    public java.util.LinkedList<Action> planMove(int i,
                                                 int x,
                                                 int y)

### planAttack

    public java.util.LinkedList<Action> planAttack(Unit actor,
                                                   Unit target)

  Uses `#getDirections(StateView, int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to follow them. then adds an attack command.

  Parameters:
    `actor` -
    `target` -
  Returns:
    A series of actions that move the actor to the target and attacks the target

### planAttack

    public java.util.LinkedList<Action> planAttack(int actor,
                                                   int target)

### planDeposit

    public java.util.LinkedList<Action> planDeposit(Unit actor,
                                                    Unit target)

  Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to move almost there. then Then adds the final direction with a gather.

  Parameters:
    `actor` -
    `target` -
    `distance` -
  Returns:

### planDeposit

    public java.util.LinkedList<Action> planDeposit(int actor,
                                                    int target)

### planGather

    public java.util.LinkedList<Action> planGather(Unit actor,
                                                   ResourceNode target)

  Uses `#getDirections(int, int, int, int, int, boolean)` to get directions to the specified place and `#planMove(Unit, LinkedList<Direction>)` to move almost there. then Then adds the final direction with a gather.

  Parameters:
    `actor` -
    `target` -
    `distance` -
  Returns:
    A series of actions that move the actor to the target and gathers from the target

### planGather

    public java.util.LinkedList<Action> planGather(int actor,
                                                   int target)

### planBuild

    public java.util.LinkedList<Action> planBuild(Unit actor,
                                                  int targetX,
                                                  int targetY,
                                                  UnitTemplate template)

### planBuild

    public java.util.LinkedList<Action> planBuild(int actor,
                                                  int targetX,
                                                  int targetY,
                                                  int template)

### planProduce

    public java.util.LinkedList<Action> planProduce(Unit actor,
                                                    Template template)

### planProduce

    public java.util.LinkedList<Action> planProduce(int actor,
                                                    int template)