Package | Description |
---|---|
cz.gyarab.util.game.rps |
Implementace známé dětské hry Kámen-nůžky-papír.
|
Modifier and Type | Method and Description |
---|---|
Shape |
Shape.beats()
Zjistí, který symbol je poražen tímto.
|
Shape |
Match.getShape(Move move,
java.lang.String player)
Zjistí symbol tažený hráčem.
|
Shape |
Match.getShape(java.lang.String player)
Zjistí poslední symbol tažený hráčem.
|
Shape |
Move.getShapeA()
Symbol zvolený hráčem A.
|
Shape |
Move.getShapeB()
Symbol zvolený hráčem B.
|
Shape |
CopyStrategy.next(Match match) |
Shape |
CyclicStrategy.next(Match match) |
Shape |
RandomStrategy.next(Match match) |
Shape |
StaticStrategy.next(Match match) |
Shape |
Strategy.next(Match match)
Zvolí symbol pro následující tah.
|
static Shape |
Shape.random()
Vybere náhodný symbol.
|
static Shape |
Shape.random(java.util.Random random)
Vybere náhodný symbol pomocí poskytnutého generátoru náhodných čísel.
|
static Shape |
Shape.valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Shape[] |
Shape.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
Move |
Match.add(Shape shapeA,
Shape shapeB)
Přidá tah do záznamu.
|
boolean |
Shape.beats(Shape opponent)
Zjistí, jestli tento symbol poráží druhý symbol.
|
void |
LeagueServer.move(Shape shape) |
int |
Shape.winner(Shape opponent)
Zjistí, kdo je vítěz souboje.
|
Constructor and Description |
---|
CopyStrategy(Shape first)
Vytvoří novou kopírovací strategii s poskytnutým symbolem pro první tah.
|
CyclicStrategy(Shape shape)
Vytvoří novou cyklickou strategii.
|
Move(Shape shapeA,
Shape shapeB,
int scoreA,
int scoreB)
Vytvoří záznam o jednom tahu (střihnutí).
|
StaticStrategy(Shape shape)
Vytvoří novou strategii.
|