Home Reference Source Repository
import GameConditions from 'roguelike/app/conditions/GameConditions.js'
public class | source

GameConditions

Abstract base class for a pair of victory and defeat conditions. Used for determining if a given game state represents a win or loss (or neither) for the player. GameConditions should be stateless.

Method Summary

Public Methods
public

Tells if the player has lost the game

public

Tells if the player has won the game

Public Methods

public hasPlayerLost(dungeon: Dungeon): boolean source

Tells if the player has lost the game

Params:

NameTypeAttributeDescription
dungeon Dungeon

The dungeon being played

Return:

boolean

true if the player has lost; false otherwise

public hasPlayerWon(dungeon: Dungeon): boolean source

Tells if the player has won the game

Params:

NameTypeAttributeDescription
dungeon Dungeon

The dungeon being played

Return:

boolean

true if the player has won; false otherwise