# Class BattlefieldSpecification

java.lang.Object
robocode.control.BattlefieldSpecification

All Implemented Interfaces:
  `Serializable`

public class BattlefieldSpecification extends Object implements Serializable
Defines the size of a battlefield, which is a part of the `BattleSpecification`.

Author:
  Mathew A. Nelson (original), Flemming N. Larsen (contributor)
See Also:
  - `BattleSpecification(int, BattlefieldSpecification, RobotSpecification[])`
  - `BattleSpecification(int, long, double, BattlefieldSpecification, RobotSpecification[])`
  - `BattleSpecification.getBattlefield()`
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`BattlefieldSpecification()`
Creates a standard 800 x 600 battlefield.
`BattlefieldSpecification(int width, int height)`
Creates a battlefield of the specified width and height.

## Method Summary

Modifier and Type
Method
Description
`int`
`getHeight()`
Returns the height of this battlefield.
`int`
`getWidth()`
Returns the width of this battlefield.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### BattlefieldSpecification

public BattlefieldSpecification()
Creates a standard 800 x 600 battlefield.

### BattlefieldSpecification

public BattlefieldSpecification(int width, int height)
Creates a battlefield of the specified width and height.

Parameters:
  `width` - the width of the battlefield, where 400 invalid input: '<'= width invalid input: '<'= 5000.
  `height` - the height of the battlefield, where 400 invalid input: '<'= height invalid input: '<'= 5000.
Throws:
  `IllegalArgumentException` - if the width or height invalid input: '<' 400 or > 5000.

## Method Details

### getWidth

public int getWidth()
Returns the width of this battlefield.

Returns:
  the width of this battlefield.

### getHeight

public int getHeight()
Returns the height of this battlefield.

Returns:
  the height of this battlefield.