Package rea.gameplay
Interface Gameplay
- All Known Implementing Classes:
EasterEggRace
,TreasureHunt
public interface Gameplay
Abstract definition of a gameplay in REA.
That is, the distinctive features of each game, such as its name,
its game map with places and items, the number of characters,
the condition in which it is completed.
- Author:
- José Paulo Leal
jpleal@fc.up.pt
- Implementation Note:
- an abstract participant of the Factory method design pattern.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
gamedEnded
(GameMap gameMap) Check if the game has ended.The set of avatars that can be used in this game.A long description of the game.int
Maximum number of players acepted in this gameint
Minimum number of players acepted in this gamegetName()
The name of the game as a short string.Produce a map for a game instance.
-
Method Details
-
getName
String getName()The name of the game as a short string.- Returns:
- name of the game
-
getDescription
String getDescription()A long description of the game.- Returns:
- description of the game
-
makeGameMap
GameMap makeGameMap()Produce a map for a game instance. A map is a collection of interconnected places. This method returns the place where the game starts. When players enter the game they will be in this place The place can (and should) be connected to other places. Each invocation of this method must return a new instance, although with a similar structure.- Returns:
- the place where the game starts
-
getAvatars
The set of avatars that can be used in this game.- Returns:
- the set of avatars
-
getMaxPlayers
int getMaxPlayers()Maximum number of players acepted in this game- Returns:
- maximum number of players
-
getMinPlayers
int getMinPlayers()Minimum number of players acepted in this game- Returns:
- minimum number of players
-
gamedEnded
Check if the game has ended. For instancem if a player (or all players) reached a certain place, or if a certain number of items have been collected.- Parameters:
gameMap
- for this game instance- Returns:
true
if the game has ended,false
otherwise
-