## robocode.control
Class BattleSpecification

    java.lang.Object
      robocode.control.BattleSpecification

All Implemented Interfaces:
  Serializable

    public class BattleSpecification

extends Object
implements Serializable

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

Author:
  Mathew A. Nelson (original), Flemming N. Larsen (contributor)
See Also:
  Serialized Form

Constructor Summary
`BattleSpecification(int numRounds, BattlefieldSpecification battlefieldSize, RobotSpecification[] robots)` Creates a new BattleSpecification with the given number of rounds, battlefield size, and robots.
`BattleSpecification(int numRounds, long inactivityTime, double gunCoolingRate, BattlefieldSpecification battlefieldSize, RobotSpecification[] robots)` Creates a new BattleSpecification with the given settings.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### 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

### 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

Method Detail

### 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.

### 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.

### getBattlefield

    public BattlefieldSpecification getBattlefield()

  Returns the battlefield size for this battle.

  Returns:
    the battlefield size for 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.

Copyright © 2010 Robocode. All Rights Reserved.