|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractAdjudicator
org.vizzini.example.gin.Adjudicator
public class Adjudicator
Provides an adjudicator for Gin.
| Field Summary |
|---|
| Fields inherited from class org.vizzini.game.AbstractAdjudicator |
|---|
_winner |
| Constructor Summary | |
|---|---|
Adjudicator()
|
|
| Method Summary | |
|---|---|
protected int[] |
counts(Collection collection)
Return a count of the cards in the given collection of card collections. |
boolean |
isActionLegal(IEnvironment environment,
IAction action)
Return true if the given action is legal in the given environment. |
boolean |
isGameOver(IEnvironment environment)
Return true if one of the agents has won, or there are no more open positions. |
protected boolean |
isGin(IAgent agent,
Collection kindsAndStraights)
Return true if the given collection is a Gin. |
boolean |
isGoal(IEnvironment environment)
Return true if one of the agents has won. |
protected void |
removeDuplicatesFromKinds(Collection kinds,
Collection straights)
Remove duplicate cards from the given kinds card collections. |
protected void |
removeDuplicatesFromStraights(Collection kinds,
Collection straights)
Remove duplicate cards from the given straights card collections. |
| Methods inherited from class org.vizzini.game.AbstractAdjudicator |
|---|
areActionsLegal, getWinner, reset, setWinner |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Adjudicator()
| Method Detail |
|---|
public boolean isActionLegal(IEnvironment environment,
IAction action)
environment - The environment of interest.action - The action in question.
public boolean isGameOver(IEnvironment environment)
environment - The environment of interest.public boolean isGoal(IEnvironment environment)
environment - The environment of interest.protected int[] counts(Collection collection)
protected boolean isGin(IAgent agent,
Collection kindsAndStraights)
protected void removeDuplicatesFromKinds(Collection kinds,
Collection straights)
protected void removeDuplicatesFromStraights(Collection kinds,
Collection straights)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |