java.lang.Object
|
+--Player
|
+--AI
This class models all aspects of the AI." You can read more about the class AI in its design documentation.
| Field Summary |
| Fields inherited from class Player |
forcePoints, planets, playerUnits, victoryPoints |
| Constructor Summary | |
AI()
|
|
| Method Summary | |
void |
admitDefeat()
Calls slightly less happy window when AI loses to human player |
void |
AI(Group AIUnits,
int forcePts,
Planet[] Iplanets)
Initial shot at constructor for AI player; requires: 1) reference to the units owned by AI player 2) number of force points accounted to AI player can be 0 if not applicable 3) reference to the planets ONLY that the AI controls |
static boolean |
CheckLethal()
Imperial turn; operations; movement: AI stacks characters with military units or space ships AI lists units which are eligible to be moved AI first moves unstacked characters ie. |
static boolean |
CheckRange()
|
int |
GroupDecision(int n)
|
char |
makeDecision(char[] m)
Selects a character from an array of available characters |
int |
makeDecision(int x)
A very boring function which can be called until such time as we code in better AI decision- making algorithms. |
void |
react()
Rebel turn; operations; enemy reaction phase: 1) AI checks for location of detected rebels/militia 2) AI compares these to locations of imperial militia 3) AI randomly moves a unit to the rebel-occupied environ 75% of the time |
void |
search()
Rebel turn; search: 1) AI makes or uses a list of detected rebels (if one is available) in same location as imperial units 2) AI searches for any/all rebels in the list 3) Successful search will always lead to combat |
void |
showTaunt()
Calls happy little window for AI to taunt human player |
void |
ToggleActive(CharacterGroup units,
int adv)
Function for deciding when imperial characters are active. |
void |
tryCombat()
Rebel turn; operations; combat phase: Imperial turn; operations; combat phase: 1) AI checks if combat is possible; if not, returns 2) AI makes list of all environs where combat is possible 3) AI steps through, removing from it environs where imperial forces are outnumbered 3:1 4) AI steps through list, assigning leaders where available 5) AI calls combat for each environ in the list |
| Methods inherited from class Player |
getForcePoints, getPlayerType, isPlayerAI, isPlayerHuman, move, Player, setForcePoints, setPlayerType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AI()
| Method Detail |
public void AI(Group AIUnits,
int forcePts,
Planet[] Iplanets)
public int makeDecision(int x)
public void react()
react in class Playerpublic void tryCombat()
public void search()
search in class Playerpublic void showTaunt()
public int GroupDecision(int n)
public char makeDecision(char[] m)
public void admitDefeat()
public static boolean CheckLethal()
public static boolean CheckRange()
public void ToggleActive(CharacterGroup units,
int adv)