org.eviline
Enum Block

java.lang.Object
  extended by java.lang.Enum<Block>
      extended by org.eviline.Block
All Implemented Interfaces:
Serializable, Comparable<Block>

public enum Block
extends Enum<Block>

A block on the playing Field. There are two block types for each ShapeType: active and inactive. Additionally, there is a block type for the outer border around the field. Empty areas in the Field are stored as nulls.

A block is active if it is a part of the currently active Shape in the field. Once a Shape locks on the field its active blocks become inactive blocks and are stored.

Author:
robin

Enum Constant Summary
G
          Ghost
I
           
IA
           
J
           
JA
           
L
           
LA
           
M
          iMpossible block
O
           
OA
           
S
           
SA
           
T
           
TA
           
U
          Unlikely block
X
          Field border
Z
           
ZA
           
 
Method Summary
 Block active()
          Returns the active version of the current block
 Color color()
           
 Block inactive()
          Returns the inactive version of the current block
 boolean isActive()
          Returns whether this is an active or inactive block
static Block valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Block[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

I

public static final Block I

T

public static final Block T

S

public static final Block S

Z

public static final Block Z

O

public static final Block O

J

public static final Block J

L

public static final Block L

IA

public static final Block IA

TA

public static final Block TA

SA

public static final Block SA

ZA

public static final Block ZA

OA

public static final Block OA

JA

public static final Block JA

LA

public static final Block LA

X

public static final Block X
Field border


G

public static final Block G
Ghost


M

public static final Block M
iMpossible block


U

public static final Block U
Unlikely block

Method Detail

values

public static Block[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Block c : Block.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Block valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isActive

public boolean isActive()
Returns whether this is an active or inactive block

Returns:

active

public Block active()
Returns the active version of the current block

Returns:
The active version of the current block

inactive

public Block inactive()
Returns the inactive version of the current block

Returns:
The inactive version of the current block

color

public Color color()


Copyright © 2013. All Rights Reserved.