gameLogic
Class GameObjectType

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

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

Represents a type of object that may be present on the board. Examples include Fruit and Wall. Instances of some GameObjectTypes are lethal to collide with, while others might give points if "eaten".

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

Constructor Summary
GameObjectType(java.lang.String name, boolean isLethal)
           
GameObjectType(java.lang.String name, boolean isLethal, int value)
          Constructs a GameObjectType object with the given name, lethality and numeric point value.
 
Method Summary
 java.lang.String getName()
          Returns the name of this GameObjectType, for instance "Fruit" or "Wall".
 int getValue()
          Gets the number of points objects of this type are worth.
 boolean isLethal()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameObjectType

public GameObjectType(java.lang.String name,
                      boolean isLethal,
                      int value)
Constructs a GameObjectType object with the given name, lethality and numeric point value.


GameObjectType

public GameObjectType(java.lang.String name,
                      boolean isLethal)
Method Detail

getName

public java.lang.String getName()
Returns the name of this GameObjectType, for instance "Fruit" or "Wall".

Returns:
the name of this GameObjectType.

getValue

public int getValue()
Gets the number of points objects of this type are worth. The default value for fruit is 1.

Returns:
the number of points that are granted by "eating" objects of this GameObjectType.

isLethal

public boolean isLethal()