-
Notifications
You must be signed in to change notification settings - Fork 8
Action serialization
Editor actions (see this page for more details) can be encapsulated using the SerializedEditorAction class. The structure of this class is defined in a json schema so it can be easily serialized to/from disk and/or network. The purpose of this serialized action is to support action logging for different purposes. Currently serialized actions are only used for bug reporting, but in the future it may also be used for creating macros and other stuff.
A serialized action contains the canonical name of the action launched, plus the serialized version of their arguments. There's also an extension of this class, called TimestampedEditorAction, that includes a time stamp. This is used for logging actions.
Each time a new action is created by invoking the Controller#action(String, Object...) method, Actions logs the action by pushing a new TimestampedEditorAction into the stack of serialized actions, just before the action is actually performed.
Actions also provide a method for retrieving a number of the actions on top of the stack, which is currently used by the Tracker.
This is an example of how two TimestampedEditorActions New Game and Open Game look when they are serialized to json:
[
{
class:es.eucm.ead.editor.control.appdata.TimestampedEditorAction,
actionClass:es.eucm.ead.editor.control.actions.NewGame,
arguments:[
{
class:java.lang.String,
value:"A folder path"
},
{
class:es.eucm.ead.schema.editor.game.EditorGame,
editScene:scene3,
initialScene:scene0,
modelVersion:"1",
appVersion:"0.9",
sceneorder:[scene0,scene1,scene3]
}
],
timestamp:"1395576753833"
},
{
class:es.eucm.ead.editor.control.appdata.TimestampedEditorAction,
actionClass:es.eucm.ead.editor.control.actions.OpenGame,
arguments:[
{
class:java.lang.String,
value:"A folder path"
}
],
timestamp:"1395576753873"
}
]eAdventure - eUCM research group
- Setting up a Development Environment
- Contributing Guidelines
- Build Process
- Project structure
- Schema
-
Engine
- Files paths and FileResolver
- Binding Schema elements with Engine elements
- Managing the game view through Layers
- Game loop and scene management
- IO
- File Resolver
- Assets: Converting schema objects to engine objects
- Engine Objects
- Actors
- Effects
- Testing the engine
- Editor
- Remote communication
- Release Process
- Other documentation