Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## robocode.control
Class BattleSpecification

    java.lang.Object
      robocode.control.BattleSpecification

All Implemented Interfaces:
  Serializable

    public class BattleSpecification

extends Object
implements Serializable

A BattleSpecification defines the settings of a battle.

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.
`robocode.battle.BattleProperties` | `getBattleProperties()` Deprecated. This methods is called by the game and is very likely to be removed in a future version of Robocode.
`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 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 robots participating in this battle.

  Returns:
    the robots participating in this battle.

### getBattleProperties

    @Deprecated
    public robocode.battle.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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD