Skip to content

00 High Level Technical Overview

Robert Silverton edited this page Jul 8, 2014 · 2 revisions

This document assumes you have already followed the CoreEditor and CadetEngine tutorials.


The aim of this document is to explain how the CadetEngine is integrated into CoreEditor via the CadetEditor extension.

At its heart, CadetEngine is a tree structure of Components and ComponentContainers. A ComponentContainer in Cadet is simply a Component with a list of child Components, each one contributing a behaviours and functionality to its parent Component.

At the core of the CadetEditor extension is the CadetEditorContext. This context wraps up a ComponentContainer, and displays the output of the scene’s current renderer. The editor is WYSIWYG (what-you-see-is-what-you-get) - what you see in the editor is exactly the same as if you were running the Cadet scene stand-alone. Things like selection brackets and grids are displayed via a system of overlays - simply DisplayObjects layered over or under the scene content.

Other contexts can inspect this scene (regarded as its data-object-model or ‘DOM’ for short), such as the Outline context - which directly displays the tree structure of the scene.


The core purpose of the editor is to allow adding and removing components from the scene. Some of the more advanced tools available in the editor, such as the terrain tool, boil down to creating bags of components and adding them to the scene - then updating properties on those components.

Because of the plug-and-play nature of Cadet, any changes are immediately seen in the output window.

When you add Components to the scene, you are presented with the ‘Add Component’ window,. The components that appear here are specified in the extension by adding multiple ComponentFactory classes to CoreApp’s ResourceManager just like everything else.


The CadetEditor extension fully supports undo, as pretty much every change you can make to a scene is wrapped up in an Operation. Adding a component to the scene boils down to adding an item to a ComponentContainer’s children array. For this there is already a AddItemOperation in the core.app.operations namespace.

See the cadetEditor.operations namespace for examples of more specific operations.