net.curre.prefcount.gui.type
Enum Place

java.lang.Object
  extended by java.lang.Enum<Place>
      extended by net.curre.prefcount.gui.type.Place
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Place>

public enum Place
extends java.lang.Enum<Place>

This enum represents player's place.

Created date: May 28, 2008

Author:
Yevgeny Nyden

Enum Constant Summary
EAST
          East side player.
NORTH
          North side player.
SOUTH
          South side player.
WEST
          West side player.
 
Field Summary
static Place[] FOUR_PLAYERS
          Four player game places.
 int index
          Index of this place relative to other places.
 java.lang.String longKey
          Place's long string resource key.
 java.lang.String shortKey
          Place's short string resource key.
static Place[] THREE_PLAYERS
          Three player game places.
 
Method Summary
static Place[] getOtherPlayersWhistPlaces(Place place, int numPlayers)
          Gets all whist places that the given player.
static Place getPlaceForIndex(int index)
          Fetches a place for the given index.
static Place[] getPlaces(int playerNum)
          Given number of player, returns array of places for this game.
static Place valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Place[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EAST

public static final Place EAST
East side player.


SOUTH

public static final Place SOUTH
South side player.


WEST

public static final Place WEST
West side player.


NORTH

public static final Place NORTH
North side player.

Field Detail

shortKey

public final java.lang.String shortKey
Place's short string resource key.


longKey

public final java.lang.String longKey
Place's long string resource key.


index

public final int index
Index of this place relative to other places.


THREE_PLAYERS

public static final Place[] THREE_PLAYERS
Three player game places.


FOUR_PLAYERS

public static final Place[] FOUR_PLAYERS
Four player game places.

Method Detail

values

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

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

valueOf

public static Place valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getPlaces

public static Place[] getPlaces(int playerNum)
Given number of player, returns array of places for this game.

Parameters:
playerNum - number of player in the game.
Returns:
array of places.

getPlaceForIndex

public static Place getPlaceForIndex(int index)
Fetches a place for the given index.

Parameters:
index - place's index.
Returns:
place for the given index.

getOtherPlayersWhistPlaces

public static Place[] getOtherPlayersWhistPlaces(Place place,
                                                 int numPlayers)
Gets all whist places that the given player.

Parameters:
place - player's place.
numPlayers - total number of player in the game.
Returns:
whist whist places for all opponents of the given player.


Copyright © 2008. All Rights Reserved.