|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectshoddybattle.BattleField
netbattle.NetBattleField
public class NetBattleField
This class represents an online battle field.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class shoddybattle.BattleField |
---|
BattleField.PokemonWrapper |
Field Summary |
---|
Fields inherited from class shoddybattle.BattleField |
---|
m_active, m_participants, m_pokemon |
Constructor Summary | |
---|---|
NetBattleField(BattleServer server,
BattleMechanics mechanics)
Allows for external construction. |
Method Summary | |
---|---|
void |
addClient(NetClient client,
Pokemon[] team)
Add a client to this battle field, along with his team of pokemon. |
void |
dispose()
Dispose of this NetBattleField. |
static int |
getBattleCount()
Return the number of battles currently ongoing. |
static java.util.Collection |
getBattleList()
Get a list of battles currently taking place. |
static java.lang.String[] |
getBattleList(int[] fids)
Get an array of the battles currently taking place. |
java.lang.String |
getDescription()
Get a description of this battle field. |
static NetBattleField |
getFieldByDescription(java.lang.String desc)
Get a NetBattleField by its description. |
static NetBattleField |
getFieldById(int id)
Get a NetBattleField object by its absolute id, which is unique within each instance of the server. |
int |
getId()
Return the absolute (unique within this instance of the server) id of this battle field. |
int |
getTrainerId(NetClient client)
Get the id in this battle field of a client. |
java.lang.String |
getTrainerName(int idx)
Get the name of a trainer. |
void |
informPokemonFainted(int party,
int idx)
Inform that a pokemon fainted. |
void |
informPokemonHealthChanged(Pokemon poke,
int hp)
A pokemon's health was changed. |
void |
informStatusApplied(Pokemon poke,
StatusEffect eff)
Inform that a status effect was applied to a pokemon. |
void |
informStatusRemoved(Pokemon poke,
StatusEffect eff)
Inform that a status effect was removed from a pokemon. |
void |
informSwitchInPokemon(int trainer,
Pokemon poke)
A pokemon was switched in. |
void |
informSwitchInPokemon(int trainer,
Pokemon poke,
boolean silent)
A pokemon was switched in. |
void |
informUseMove(Pokemon poke,
java.lang.String name)
Inform that a pokemon used a move. |
void |
informVictory(int trainer)
A player has won. |
void |
queueMove(int trainer,
BattleTurn move)
Process a move sent in by a client. |
void |
refreshActivePokemon()
Refresh all active pokemon. |
void |
refreshStats()
Refresh all players' statistics. |
void |
refreshStats(int trainer)
Refresh a player's statistics. |
void |
removeClient(NetClient remove)
Remove a client from this battle field. |
void |
requestAndWaitForSwitch(int party)
Wait for a player to switch pokemon. |
protected void |
requestMoves()
Request moves for the next turn. |
protected void |
requestPokemonReplacement(int i)
Obtain a replacement pokemon for the team identified by the parameter. |
void |
showMessage(java.lang.String message)
Narrate the battle. |
void |
showMessage(java.lang.String message,
boolean important)
|
Methods inherited from class shoddybattle.BattleField |
---|
addClause, allowsStatus, applyEffect, attachField, checkBattleEnd, executeTurn, getActivePokemon, getAliveCount, getEffectByType, getEffectiveness, getEffectsByType, getMechanics, getOpponent, getParty, getPokemonTrainer, getRandom, getStruggle, isNarrationEnabled, removeEffect, replaceFaintedPokemon, setNarrationEnabled, setPokemon, switchInPokemon, synchroniseFieldEffects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NetBattleField(BattleServer server, BattleMechanics mechanics)
Method Detail |
---|
public void dispose()
dispose
in class BattleField
public java.lang.String getDescription()
public static java.util.Collection getBattleList()
public static int getBattleCount()
public static NetBattleField getFieldByDescription(java.lang.String desc)
public static NetBattleField getFieldById(int id)
public static java.lang.String[] getBattleList(int[] fids)
public int getId()
public void informStatusApplied(Pokemon poke, StatusEffect eff)
informStatusApplied
in class BattleField
public void informStatusRemoved(Pokemon poke, StatusEffect eff)
informStatusRemoved
in class BattleField
public java.lang.String getTrainerName(int idx)
getTrainerName
in class BattleField
idx
- the trainer whose name to get.public int getTrainerId(NetClient client)
public void addClient(NetClient client, Pokemon[] team)
public void removeClient(NetClient remove)
public void informUseMove(Pokemon poke, java.lang.String name)
informUseMove
in class BattleField
poke
- the pokemon who used the movename
- the name of the move that was usedprotected void requestPokemonReplacement(int i)
requestPokemonReplacement
in class BattleField
public void showMessage(java.lang.String message)
showMessage
in class BattleField
public void showMessage(java.lang.String message, boolean important)
public void informPokemonFainted(int party, int idx)
informPokemonFainted
in class BattleField
public void refreshActivePokemon()
refreshActivePokemon
in class BattleField
public void informSwitchInPokemon(int trainer, Pokemon poke, boolean silent)
public void informSwitchInPokemon(int trainer, Pokemon poke)
informSwitchInPokemon
in class BattleField
public void informPokemonHealthChanged(Pokemon poke, int hp)
informPokemonHealthChanged
in class BattleField
public void informVictory(int trainer)
informVictory
in class BattleField
public void refreshStats()
public void refreshStats(int trainer)
public void requestAndWaitForSwitch(int party)
requestAndWaitForSwitch
in class BattleField
public void queueMove(int trainer, BattleTurn move) throws MoveQueueException
queueMove
in class BattleField
MoveQueueException
protected void requestMoves()
requestMoves
in class BattleField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |