### robocode.control

# Class BattleSpecification

- `java.lang.Object`
- - `robocode.control.BattleSpecification`

Implemented Interfaces:
  Serializable

`public class BattleSpecification`
`extends Object`
`implements Serializable`

A BattleSpecification defines battle configuration used by the `RobocodeEngine`.

Authors:
  Mathew A. Nelson (original)
  Flemming N. Larsen (contributor)

See Also:
  Serialized Form

  ## Constructor Summary

  `BattleSpecification(int numRounds, long inactivityTime, double gunCoolingRate, BattlefieldSpecification battlefieldSize, RobotSpecification[] robots)`
    Creates a new BattleSpecification with the given settings.

  `BattleSpecification(int numRounds, BattlefieldSpecification battlefieldSize, RobotSpecification[] robots)`
    Creates a new BattleSpecification with the given number of rounds, battlefield size, and robots.

  ## Method Summary

  `@Deprecated`

  `BattleProperties getBattleProperties()`
    Deprecated. This methods is called by the game and is very likely to be removed in a future version of Robocode.

  `BattlefieldSpecification`

  `getBattlefield()`
    Returns the battlefield size for this battle.

  `double`

  `getGunCoolingRate()`
    Returns the gun cooling rate of the robots in this battle.

  `long`

  `getInactivityTime()`
    Returns the allowed inactivity time for the robots in this battle.

  `int`

  `getNumRounds()`
    Returns the number of rounds in this battle.

  `RobotSpecification[]`

  `getRobots()`
    Returns the specifications of the robots participating in this battle.

## Constructor Details

### BattleSpecification

    public BattleSpecification(int numRounds,
                               long inactivityTime,
                               double gunCoolingRate,
                               BattlefieldSpecification battlefieldSize,
                               RobotSpecification[] robots)

> Creates a new BattleSpecification with the given settings.
> Parameters:
>   `numRounds` - the number of rounds in this battle
>   `inactivityTime` - the inactivity time allowed for the robots before they will loose energy
>   `gunCoolingRate` - the gun cooling rate for the robots
>   `battlefieldSize` - the battlefield size
>   `robots` - the robots participating in this battle

### BattleSpecification

    public BattleSpecification(int numRounds,
                               BattlefieldSpecification battlefieldSize,
                               RobotSpecification[] robots)

> Creates a new BattleSpecification with the given number of rounds, battlefield size, and robots. Inactivity time for the robots defaults to 450, and the gun cooling rate defaults to 0.1.
> Parameters:
>   `numRounds` - the number of rounds in this battle
>   `battlefieldSize` - the battlefield size
>   `robots` - the robots participating in this battle

## Method Details

### BattleProperties getBattleProperties

    public @Deprecated BattleProperties getBattleProperties()

> Deprecated. This methods is called by the game and is very likely to be removed in a future version of Robocode.

> Do not call this method!
> Returns:
>   the properties of this battle.

### getBattlefield

    public BattlefieldSpecification getBattlefield()

> Returns the battlefield size for this battle.
> Returns:
>   the battlefield size for this battle.

### getGunCoolingRate

    public double getGunCoolingRate()

> Returns the gun cooling rate of the robots in this battle.
> Returns:
>   the gun cooling rate of the robots in this battle.

### getInactivityTime

    public long getInactivityTime()

> Returns the allowed inactivity time for the robots in this battle.
> Returns:
>   the allowed inactivity time for the robots in this battle.

### getNumRounds

    public int getNumRounds()

> Returns the number of rounds in this battle.
> Returns:
>   the number of rounds in this battle.

### getRobots

    public RobotSpecification[] getRobots()

> Returns the specifications of the robots participating in this battle.
> Returns:
>   the specifications of the robots participating in this battle.