-
Notifications
You must be signed in to change notification settings - Fork 0
MPW Meta Model
Represents the root class of the world. It contains the Stage
and the CommandStack
.
Represents the 2D grid-based world which consists of Tile
s.
A stage is able to process commands, e.g. to initialize the tiles.
Inherits: Entity
from command-package.
Example Hamster-Simulation: Inherited by Territory
which can contain Grain
s, Wall
s and Hamster
s.
Represents one place on the 2D grid and defines a unique Location
, which stores the column and row indices.
Inherits: Entity
from command-package.
Represents a component which might be placed on a Tile
.
Inherits: Entity
from command-package.
Example Hamster-Simulation: Grain
, Wall
or Hamster
.
Special sub-type of TileContent
which represents the client object on the Stage
.
An actor provides the typical commands to control the game state like movement.
Additionally it provides several queries to obtain game state information.
Example Hamster-Simulation: Hamster
with Move
, PickGrain
, PutGrain
or TurnLeft
commands and FrontIsClear
, MouthEmpty
, Direction
, or Location
queries.
Represents a requisite on the Stage
which has no own commands.
A prop can have the ability to block a Tile
, so no Actor
is able to move on it.
Example Hamster-Simulation: Grain
or Wall
.
Base class of an entity which defines property modifications used by commands. It makes use of Object
s to provide a reflection-like possibility to set values by property-names.
Note: In Java it can be simply realized by reflection, but in languages like C++ not.
Represents a base type of any value. In java this is simply the type java.lang.Object
. In C++ this may be an union of possible values: it can be a primitive value like integers, booleans or strings. Alternatively it can be a reference/pointer.
Defines the basic type for PrimitiveCommand
or CompositeCommand
which represent behavior which can be executed.
It provides the ability to: execute, undo or redo.
Commands are processed in context of an Actor
or the Stage
.
Tracks the executed Command
s which allow to undo and redo their behavior.
Defines a primitive command which can set, add or removes values regarding to a property of an Entity
.
A primitive command which adds an entity to a collection property.
A primitive command which sets a generic value (Object
) to a property.
A primitive command which removes an entity from a collection property.
A more complex type of commands which makes use of multiple sub-commands. Usually the sub-commands are PrimitiveCommand
s.
Example Hamster-Simulation: Game commands: Move
, PickGrain
, PutGrain
or TurnLeft
. Editor commands: InitTerritory
or InitHamster
.