abstract class Game

Direct Known Subclasses

Defined in:

common/game.cr
server/game.cr

Constant Summary

GAME_TYPE = {"RPS" => RockPaperScissors, "C4" => FourInARow, "Fight" => Fight}

Instance Method Summary

Instance Method Detail

def add_player(player : Player) #

[View source]
def broadcast(msg, player2socket) #

[View source]
def id : GameId #

[View source]
abstract def min_players : Int32 #

[View source]
abstract def parse_move?(move) : Game::Move | Nil #

[View source]
abstract def play(player_id : PlayerId, move : Move) #

[View source]
def play!(player_id, move) #

[View source]
def players : Array(Player) #

[View source]
def players=(players : Array(Player)) #

[View source]
def remove_player(player_id) #

[View source]
def status : GameStatus #

[View source]
def turn : PlayerId | Nil #

[View source]