B C D E G H I M P S T V W

B

Board - Class in gameLogic
This class represents the entire game board through a 2D-array of Square objects.
Brain - Interface in gameLogic
This is the interface a participant needs to implement into his or her code.

C

calculateNextPosition(Position) - Method in enum gameLogic.Direction
Gets the next position a snake would end up in if it continues in this direction.
calculateNextPosition(Direction, Position) - Static method in class gameLogic.GameState
Gets the next position a snake would end up in if it continues in this direction.

D

Direction - Enum in gameLogic
This is an enum representing a direction in which a snake can move.
distanceBetween(Position, Position) - Static method in class gameLogic.GameState
This method can be used to calculate the distance between two positions.

E

equals(Object) - Method in class gameLogic.Position
 
ErrorState - Enum in gameLogic
ErrorState is used to check if a Brain has been doing something bad the last turn.

G

gameLogic - package gameLogic
 
GameObject - Class in gameLogic
This class represents an object that exists on the game board.
GameObjectType - Class in gameLogic
Represents a type of object that may be present on the board.
GameObjectType(String, boolean, int) - Constructor for class gameLogic.GameObjectType
Constructs a GameObjectType object with the given name, lethality and numeric point value.
GameObjectType(String, boolean) - Constructor for class gameLogic.GameObjectType
 
GameState - Class in gameLogic
The GameState is a representation of the game at a given moment in time.
getBoard() - Method in class gameLogic.GameState
Returns a Board object, which constists of a 2D-array of Square objects.
getBoardHeight() - Method in class gameLogic.Metadata
Gets the height of the game board.
getBoardWidth() - Method in class gameLogic.Metadata
Gets the width of the game board.
getColor() - Method in class gameLogic.Snake
 
getCurrentDirection() - Method in class gameLogic.Snake
Gets the direction this snake moved in last turn.
getDirection(Position) - Method in class gameLogic.Snake
Get the direction of a specific segment in this snake.
getDirectionFromPositionToPosition(Position, Position) - Static method in enum gameLogic.Direction
Returns the direction between two positions, as long as they are on a straight line.
getDirectionVector() - Method in enum gameLogic.Direction
 
getDistanceTo(Position) - Method in class gameLogic.Position
Calculates the manhattan distance (the number of squares that must be traversed) between this Position and another Position.
getErrorState() - Method in class gameLogic.GameState
Returns the ErrorState for the previous turn, for example telling a brain it took too long to decide last turn.
getFruitFrequency() - Method in class gameLogic.Metadata
Gets the number of turns it takes for fruit to spawn.
getFruitGoal() - Method in class gameLogic.Metadata
Gets the number of total fruit required to win the game.
getFruits() - Method in class gameLogic.GameState
Gets a list containing the positions of all the fruits currently on the board.
getGrowthFrequency() - Method in class gameLogic.Metadata
Gets the number of turns it takes for snakes to grow.
getHeadPosition() - Method in class gameLogic.Snake
Gets the current position of this snake's head.
getHeight() - Method in class gameLogic.Board
Gets the height of the board (the 2D-array).
getLifespan() - Method in class gameLogic.Snake
Gets the number of turns this snake has lived.
getMaximumThinkingTime() - Method in class gameLogic.Metadata
Gets the thinking time each snake has each turn, in milliseconds.
getMetadata() - Method in class gameLogic.GameState
Method for getting the current game metadata, containing (among other things) time until the next fruit spawns and time until snake growth.
getName() - Method in class gameLogic.GameObjectType
Returns the name of this GameObjectType, for instance "Fruit" or "Wall".
getName() - Method in class gameLogic.Snake
 
getNeighbours() - Method in class gameLogic.Position
Get a list of all neighbours to this position.
getNextMove(Snake, GameState) - Method in interface gameLogic.Brain
Returns which direction this brain wishes its snake to move in.
getRelativeDirections(Position, Position) - Static method in class gameLogic.GameState
Returns in which direction one has to move in order to reach one position from another one.
getScore() - Method in class gameLogic.Snake
Gets the number of fruits this snake has eaten.
getSegments() - Method in class gameLogic.Snake
Get a list of all the squares this snake has occupied.
getSnakes() - Method in class gameLogic.GameState
Returns a Set containing all snakes in the game, both dead ones and alive ones.
getSnakes() - Method in class gameLogic.Square
Generates a list of all snakes in this square.
getSquare(Position) - Method in class gameLogic.Board
Gets a Square at
getTailPosition() - Method in class gameLogic.Snake
Gets the current position of the last segment of the snake's tail.
getType() - Method in class gameLogic.GameObject
Gets the GameObjectType of this object.
getValue() - Method in class gameLogic.GameObjectType
Gets the number of points objects of this type are worth.
getWalls() - Method in class gameLogic.GameState
Gets a list containing the positions of all the walls currently on the board.
getWidth() - Method in class gameLogic.Board
Gets the width of the board (the 2D-array).
getX() - Method in class gameLogic.Position
Gets the X coordinate of this position object.
getY() - Method in class gameLogic.Position
Gets the Y coordinate of this position object.

H

hasFruit(Position) - Method in class gameLogic.Board
Returns whether or not the board contains a fruit at the given position.
hasFruit() - Method in class gameLogic.Square
Returns whether or not this Square contains a fruit.
hasGameObject(Position) - Method in class gameLogic.Board
Returns whether or not the board contains any game object at the given position.
hashCode() - Method in class gameLogic.Position
 
hasLethalObjectWithinRange(Position, int) - Method in class gameLogic.Board
Calculates whether or not the board contains a lethal object within a given radius of a certain square.
hasObjectType(String) - Method in class gameLogic.Square
 
hasSnake(Position) - Method in class gameLogic.Board
Returns whether or not the board contains a snake at the given position.
hasSnake() - Method in class gameLogic.Square
Returns whether or not this Square contains a snake.
hasWall(Position) - Method in class gameLogic.Board
Returns whether or not the board contains a wall at the given position.
hasWall() - Method in class gameLogic.Square
Returns whether or not this Square contains a wall.

I

isDead() - Method in class gameLogic.Snake
Returns whether or not this snake is dead.
isEmpty() - Method in class gameLogic.Square
Returns whether or not this Square is empty, e.g. has no game objects inside it.
isLethal(Position) - Method in class gameLogic.Board
Returns whether or not the board contains a lethal game object at the given position.
isLethal() - Method in class gameLogic.GameObjectType
 
isLethal() - Method in class gameLogic.Square
Checks if this square is lethal, e.g. if it contains a lethal GameObject.

M

Metadata - Class in gameLogic
This class contains all the metadata concerning the current game session.
Metadata(int, int, int, int, int, int) - Constructor for class gameLogic.Metadata
 

P

Position - Class in gameLogic
Represents a coordinate (x and y position) on the game board.
Position(int, int) - Constructor for class gameLogic.Position
Constructs a Position object with the given coordinates.
Position(Position) - Constructor for class gameLogic.Position
 

S

Snake - Class in gameLogic
The Snake class is a representation of each snake currently in the game, including its name, its current direction, its position on the game board, and its current statistics.
Snake(GameObjectType, String, Brain, Color) - Constructor for class gameLogic.Snake
 
Snake(Snake) - Constructor for class gameLogic.Snake
 
Square - Class in gameLogic
Objects of this class represent a single square of the game board.

T

toString() - Method in enum gameLogic.ErrorState
Converts the enum label into a human readable string, describing the error.
toString() - Method in class gameLogic.Position
 
toString() - Method in class gameLogic.Snake
Returns a string representation of this snake, consisting of a String of its name.
turnLeft() - Method in enum gameLogic.Direction
Returns a new direction that would be the same as turning left.
turnRight() - Method in enum gameLogic.Direction
Returns a new direction that would be the same as turning right.

V

valueOf(String) - Static method in enum gameLogic.Direction
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum gameLogic.ErrorState
Returns the enum constant of this type with the specified name.
values() - Static method in enum gameLogic.Direction
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum gameLogic.ErrorState
Returns an array containing the constants of this enum type, in the order they are declared.

W

willCollide(Snake, Direction) - Method in class gameLogic.GameState
This method can be used to help calculate whether or not a given snake will collide next turn if it continues in a given direction.

B C D E G H I M P S T V W