Game: R6 Class Representing a Game

Description Details Methods

Description

A game consists of a board and a player, it also tracks the number of turns and is used to play the game.

Details

Call the play function to play out a game, or call turn to step through a game

Methods

Public methods


Method turn()

Usage
Game$turn()

Method play()

Usage
Game$play()

Method new()

Usage
Game$new(board = Board$new(mines = 20), player = Player$new())

Method print()

Usage
Game$print(...)

Method clone()

The objects of this class are cloneable with this method.

Usage
Game$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


kieran-mace/MineSweeper documentation built on Dec. 21, 2021, 6:40 a.m.