Package rea.components


package rea.components

Components of a gameplay, the set of feature of a game. These include a GameMap that has a direct acyclic graph (DAG) whose nodes are Place connected by Passage. Places contain a collection of Positionable components, namely:

Character
components in the game capable of executing an Action
Item
components that can be picked, collected and used in the game;
Passage
components that connect to another an Place

As the name suggests, positionable components have a Position, cartesian coordinates in place. The coordinates are for the center of the component and relative to the upper left corner of the place.

Both Places and positionable components have a Visual, i.e. a graphic representation as image file with a certain dimension.

The game map's DAG follows the Composite design pattern, with Component as the abstract participant, Place ad container and the positionable conponents as leaves.

Exploiting the fact that the DAG is a composite, it can be transversed by a Visitor. To achive this, all components implement the Element interface. These interfaces are abstract components of the Visitor design pattern.

Author:
José Paulo Leal jpleal@fc.up.pt
  • Class
    Description
    An avatar is a set of features from character.
    A character in the game.
    Abstract class common to all classes implementing the game map structure.
    The Element interface.* This type ust be added to the Component of the Composite to ensure that all types of the structure implement it.
    The game map.
    An item in the game, such as a key, a sword, a potion, etc.
    A way to a place.
    A place in the game.
    A position in the game map.
    A positionable object in the game.
    The Visitor interface.
    A visual representation of a game component.