gameLogic
Class Metadata

java.lang.Object
  extended by gameLogic.Metadata
All Implemented Interfaces:
java.io.Serializable

public class Metadata
extends java.lang.Object
implements java.io.Serializable

This class contains all the metadata concerning the current game session. such as the size of the map, the thinking time for the snakes, the frequency at which snakes grow, the frequency at which fruit spawns and the number of fruits snakes need to eat to win.

Author:
Sixten Hilborn, Arian Jafari
See Also:
Serialized Form

Constructor Summary
Metadata(int boardWidth, int boardHeight, int growthFrequency, int fruitFrequency, int thinkingTime, int fruitGoal)
           
 
Method Summary
 int getBoardHeight()
          Gets the height of the game board.
 int getBoardWidth()
          Gets the width of the game board.
 int getFruitFrequency()
          Gets the number of turns it takes for fruit to spawn.
 int getFruitGoal()
          Gets the number of total fruit required to win the game.
 int getGrowthFrequency()
          Gets the number of turns it takes for snakes to grow.
 int getMaximumThinkingTime()
          Gets the thinking time each snake has each turn, in milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metadata

public Metadata(int boardWidth,
                int boardHeight,
                int growthFrequency,
                int fruitFrequency,
                int thinkingTime,
                int fruitGoal)
Method Detail

getBoardWidth

public int getBoardWidth()
Gets the width of the game board.

Returns:
The width of the board.

getBoardHeight

public int getBoardHeight()
Gets the height of the game board.

Returns:
The height of the board.

getMaximumThinkingTime

public int getMaximumThinkingTime()
Gets the thinking time each snake has each turn, in milliseconds.

Returns:
The thinking time in milliseconds.

getGrowthFrequency

public int getGrowthFrequency()
Gets the number of turns it takes for snakes to grow. Note that this is not the same thing as the number of turns that remain until the next time snakes grow.

Returns:
The frequency (in turns) with which snakes grow.

getFruitFrequency

public int getFruitFrequency()
Gets the number of turns it takes for fruit to spawn. Note that this is not the same thing as the number of turns that remain until the next time snakes grow.

Returns:
The frequency (in turns) with which snakes grow.

getFruitGoal

public int getFruitGoal()
Gets the number of total fruit required to win the game.

Returns:
The number of fruit required to win the game.