Skip to content

Implementation Role Feature 10

Max Leuthäuser edited this page Aug 7, 2015 · 3 revisions

Title

The state of an object can be role-specific

Description

The state of an object may vary depending on the role in which it is being addressed.

Implementation

Roles are implemented with classes and their state is of course instance specific. By merging the roles instances with its player object with the play-method (or the playing-method) semantically they become one (compound object as I call it). At the end you have the state of the core object, the states of the role instances and the (merged) state of the resulting compound object.

Additional hints

None.

Clone this wiki locally