|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectj4cevo.Brain
A brain belongs to one particular player and is informed whenever any action
for this player is required. Brain receives all calls from the game server.
To build your own AI this class has to be subclassed. In order to be load at
runtime, the customized AI has to be compiled and reside in the same
directory as j4cEvo.dll and cEvo. exe. j4cEvo uses
a standard property file named j4cEvo.properties to determine which AI to
use for which seat number (AFAIK this is the only information passed from
cEvo).
example for sampleai.Player on seat 8:
8=sampleai/Brain
please note the slash as package separator
When running cEvo, just place j4cEvo on a seat(in cEvo 0.9.1 left top seat
has number 8), other as follows
812
703
654
j4cEvo will load the mentioned class. Additionaly this class is used as a
Factory for managed objects - according create methods may be
overriden to create customized versions of the managed objects.
| Constructor Summary | |
Brain()
|
|
| Method Summary | |
protected abstract void |
breakGame()
Called just before the game ends. |
protected abstract void |
cityChanged(int index)
Called when a new city was founded. |
protected abstract void |
contactAccepted()
Diplomacy: Enemy has accepted contact request. |
protected abstract void |
contactEnded()
Diplomacy: Enemy end negotiation (Not fully understood by me, needs further investigation. okrumnow) |
protected abstract void |
contactRejected()
Diplomacy: Enemy rejected contact request (Not fully understood by me, needs further investigation. okrumnow) |
protected abstract void |
contactRequested(Enemy e)
Called when another player tries to start Diplomacy with us. |
protected City |
createCity()
Hook for subclasses. |
protected Enemy |
createEnemy()
Hook for subclasses. |
protected EnemyCity |
createEnemyCity()
Hook for subclasses. |
protected EnemyModel |
createEnemyModel()
Hook for subclasses. |
protected EnemyUnit |
createEnemyUnit()
Hook for subclasses. |
protected Model |
createModel()
Hook for subclasses. |
protected PlayerCity |
createPlayerCity()
Hook for subclasses. |
protected Unit |
createUnit()
Hook for subclasses. |
protected abstract void |
decisionNoticed()
Diplomacy: Enemy has noticed latest decision, continue with negotiation now. |
Player |
getPlayer()
Gets the player attribute of the Brain object |
protected abstract void |
getReady()
Calls just before the first turn after starting or loading a game. |
protected abstract void |
negotiationBroken()
Diplomacy: Enemy has broken negotiation. |
protected abstract void |
offerAccepted()
Diplomacy: Enemy accepts latest offer. |
protected abstract void |
receiveOffer(Offer offer)
Diplomacy: Enemy makes an offer. |
protected abstract void |
treatyCanceled(Enemy e)
Diplomacy: Enemy cancels current treaty. |
protected abstract void |
turn()
Player is due to make a turn. |
protected abstract void |
unitMoved(java.nio.ByteBuffer b,
int command)
An enemy unit has moved. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Brain()
| Method Detail |
protected abstract void getReady()
protected abstract void breakGame()
protected abstract void cityChanged(int index)
index - Index of the cityprotected abstract void contactAccepted()
protected abstract void contactEnded()
protected abstract void contactRejected()
protected abstract void contactRequested(Enemy e)
e - The enemy that started Diplomacyprotected City createCity()
City
protected Enemy createEnemy()
Enemy
protected EnemyCity createEnemyCity()
EnemyCity
protected EnemyModel createEnemyModel()
EnemyModel
protected EnemyUnit createEnemyUnit()
EnemyUnit
protected Model createModel()
Model
protected PlayerCity createPlayerCity()
PlayerCity
protected Unit createUnit()
Unit
protected abstract void decisionNoticed()
protected abstract void negotiationBroken()
protected abstract void offerAccepted()
protected abstract void receiveOffer(Offer offer)
offer - The offer made by the enemyprotected abstract void treatyCanceled(Enemy e)
e - The Enemy that cancelled the state treaty.protected abstract void turn()
protected abstract void unitMoved(java.nio.ByteBuffer b,
int command)
b - Description of the Parametercommand - type of action the unit performedProtocol.cShowMovepublic final Player getPlayer()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||