Home Reference Source
import Game from 'cards/src/game.js'
public class | source

Game

Direct Subclass:

src/pontoon.js~Pontoon

Common functionality for text based card game

Constructor Summary

Public Constructor
public

Creates a new game and fires up a repl for writing to, via a Queue

Member Summary

Public Members
public

deck: *

public

log: *

public

name: *

public

queue: *

public

repl: *

Method Summary

Public Methods
public

begin()

Welcomes the player to the game

public

Asks the player if they would like to play another game

public

write(msg: string)

Writes a message to the repl

Public Constructors

public constructor(name: string) source

Creates a new game and fires up a repl for writing to, via a Queue

Params:

NameTypeAttributeDescription
name string

Identifier for the game, e.g. 'Whist'

Public Members

public deck: * source

public log: * source

public name: * source

public queue: * source

public repl: * source

Public Methods

public begin() source

Welcomes the player to the game

public playAgain() source

Asks the player if they would like to play another game

public write(msg: string) source

Writes a message to the repl

Params:

NameTypeAttributeDescription
msg string