wyvern.lib.ai
Class ShipAI

java.lang.Object
  extended byjava.lang.Thread
      extended bywyvern.kernel.commands.AbstractAI
          extended bywyvern.lib.ai.ShipAI
All Implemented Interfaces:
AI, java.lang.Runnable

public class ShipAI
extends AbstractAI

Implements the AI for sailing ships (e.g. pirate ships); needs work.

Version:
1.0, Nov 13, 1997
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.kernel.commands.AbstractAI
commandables_, commandList_, queues_
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface wyvern.lib.AI
DEFAULT_MONSTER_INERTIA, DEFAULT_WANDER_RANGE
 
Method Summary
static AI add(Commandable c)
          Puts a commandable under this AI's control.
 int chooseDir()
          Chooses a random direction (N, S, E or W)
static AI getImpl()
          Returns the implementation object.
 void think(Commandable m, EventQueue q)
          Decide what to do next.
 
Methods inherited from class wyvern.kernel.commands.AbstractAI
addCommandable, addToHateList, chooseRandomDir, getAverageTime, getCommand, getNumThinks, getProfilingInfo, getTotalTime, isControlling, moveRandomly, notifyAttacked, registerCommand, removeCommandable, requestEvent, run, serviceQueues, thinkForQueue, unregisterCommand
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

add

public static AI add(Commandable c)
Puts a commandable under this AI's control.

Parameters:
c - a commandable to add
Returns:
the AI instance that the commandable was added to

getImpl

public static AI getImpl()
Returns the implementation object.


think

public void think(Commandable m,
                  EventQueue q)
Decide what to do next. Called by superclass when q is ready.

Specified by:
think in interface AI
Specified by:
think in class AbstractAI
Parameters:
m - the commandable to think for
q - the commandable's event queue

chooseDir

public int chooseDir()
Chooses a random direction (N, S, E or W)