robocode.control
Class BattleSpecification

java.lang.Object
  extended by 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.
BattleSpecification(int numRounds, long inactivityTime, double gunCoolingRate, boolean hideEnemyNames, 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.
 boolean getHideEnemyNames()
          Flag specifying if the enemy names must be hidden from events sent to robots.
 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

BattleSpecification

public BattleSpecification(int numRounds,
                           long inactivityTime,
                           double gunCoolingRate,
                           boolean hideEnemyNames,
                           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
hideEnemyNames - flag specifying if enemy names are hidden from robots
battlefieldSize - the battlefield size
robots - the robots participating in this battle
Since:
1.7.3
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.

getHideEnemyNames

public boolean getHideEnemyNames()
Flag specifying if the enemy names must be hidden from events sent to robots.

Returns:
true if the enemy names must be hidden; false otherwise.
Since:
1.7.3

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 © 2013 Robocode. All Rights Reserved.