The state of a battle. Represents all data about a battle.
Value parameters
- activePokemon
-
the pokemon currently active on the battlefield
- battleType
-
the type of the battle (e.g singles)
- currentRequest
-
the last pending choice request sent by the server
- currentTurn
-
the current turn of this battle
- field
-
the currently active terrain effects
- format
-
this battle's format
- generation
-
this battle's generation
- players
-
this battle's participants
- result
-
the result of this battle if it ended
- rules
-
this battle's rules
- sides
-
the currently active side-bound effects
- state
-
the game state of this battle (initialization, playing...)
- timerEnabled
-
whether the time for each turn is limited or not
- weather
-
the weather currently active on the battlefield
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Change the local position of a pokemon.
Change the local position of a pokemon.
Value parameters
- position
-
the current position of the pokemon
- slot
-
the slot to move the pokemon to
Attributes
- Returns
-
a copy of this battle with the given pokemon moved
Declare a new team member.
Declare a new team member.
Value parameters
- playerNumber
-
the pokemon's owner
- teamPokemon
-
the pokemon to add to the team
Attributes
- Returns
-
a copy of this battle with the given pokemon added
Get the pokemon active at the given position.
Get the pokemon active at the given position.
Value parameters
- position
-
the position of the pokemon
Attributes
- Returns
-
the pokemon currently active at
position
Get the team member of a player.
Get the team member of a player.
Value parameters
- player
-
the pokemon's owner
- slot
-
the slot of the pokemon in the player's team
Attributes
- Returns
-
the inactive pokemon at the given position
Get the inactive data of the pokemon active at the given position.
Get the inactive data of the pokemon active at the given position.
Value parameters
- position
-
the position of the pokemon
Attributes
- Returns
-
the TeamMember of the pokemon currently active at
position
Retrieve the slot of a team member using its details.
Retrieve the slot of a team member using its details.
Value parameters
- details
-
the details of the pokemon
- playerNumber
-
the owner of the member's team
Attributes
- Returns
-
the slot matching with the given details
Transform a pokemon into another, like the ability.
Transform a pokemon into another, like the ability.
Value parameters
- pokemonPosition
-
the position of the pokemon to transform
- targetPosition
-
the position of the pokemon to copy
Attributes
- Returns
-
a copy of this battle with the pokemon transformed
Update this data according to the passed server event/message.
Update this data according to the passed server event/message.
Value parameters
- message
-
the message sent by the server
Attributes
- Returns
-
a new Battle updated according to the given message
Update a pokemon represented by its position.
Update a pokemon represented by its position.
Value parameters
- f
-
the function to apply to the pokemon
- position
-
the position of the pokemon
Attributes
- Returns
-
a copy of this battle with the pokemon updated
Update all currently active pokemon.
Update all currently active pokemon.
Value parameters
- f
-
the function to apply to the pokemon
Attributes
- Returns
-
a copy of this battle with the active pokemon updated
Update a player represented by its number.
Update a player represented by its number.
Value parameters
- f
-
the function to apply to the player
- number
-
the numeric id of the player
Attributes
- Returns
-
a copy of this battle with the player updated
Update the side condition of a player.
Update the side condition of a player.
Value parameters
- f
-
the function to apply to the side condition
- side
-
the side to update
Attributes
- Returns
-
a copy of this battle with the given side updated
Update the inactive data of a currently active pokemon represented by its position.
Update the inactive data of a currently active pokemon represented by its position.
Value parameters
- f
-
the function to apply to the pokemon
- position
-
the position of the pokemon
Attributes
- Returns
-
a copy of this battle with the pokemon updated
Set the active pokemon at a given position.
Set the active pokemon at a given position.
Value parameters
- pokemon
-
the pokemon to set at
position
- position
-
the position to place the pokemon at
Attributes
- Returns
-
a copy of this battle with the given pokemon
Set the inactive information of a pokemon currently active at a given position.
Set the inactive information of a pokemon currently active at a given position.
Value parameters
- position
-
the current position of the pokemon
- teamPokemon
-
the inactive information to set
Attributes
- Returns
-
a copy of this battle with the given pokemon
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product