Table of Contents

Class EditorPresenter

Namespace
FrameOfReference.Presentation
Assembly
FrameOfReference.Presentation.dll

Displays a map for editing

public sealed class EditorPresenter : InteractivePresenter, IDisposable, IInputReceiver
Inheritance
EditorPresenter
Implements
Inherited Members
Extension Methods

Constructors

EditorPresenter(Engine, Universe, bool)

Creates a new editor presenter

public EditorPresenter(Engine engine, Universe universe, bool lighting)

Parameters

engine Engine

The engine to use for rendering

universe Universe

The universe to display

lighting bool

Shall lighting be used for rendering?

Properties

MaxCameraRadius

The value for MaxRadius.

protected override double MaxCameraRadius { get; }

Property Value

double

TerrainBrush

Controls the shape and size of the area that is visuallly highlighted for TerrainPainting.

public TerrainBrush? TerrainBrush { get; set; }

Property Value

TerrainBrush?

Remarks

Raise the TerrainPaint event instead of selecting Positionable<TCoordinates>s when set to a value other than null.

Methods

AreaSelection(Rectangle, bool, bool)

Called when the user is selecting an area on the screen.

public override void AreaSelection(Rectangle area, bool accumulate, bool done)

Parameters

area Rectangle

The selected area in pixels. The bottom-right corner is always the last point selected by the user, therefore the box may be inverted.

accumulate bool

true when the user wants the new selection to be added to the old one.

done bool

True when the user has finished his selection (e.g. released the mouse).

Click(MouseEventArgs, bool)

Called when the user clicked something (not dragged!).

public override void Click(MouseEventArgs e, bool accumulate)

Parameters

e MouseEventArgs

The original event arguments from the click.

accumulate bool

true when the user wants the action to have an accumulative effect (usually for selections).

GetCollisionBox()

Calculates a collision Box from the SlimDX.BoundingBoxs of pickable PositionableRenderables.

public Box GetCollisionBox()

Returns

Box

GetCollisionCircle()

Calculates a collision Circle from the SlimDX.BoundingSpheres of pickable PositionableRenderables.

public Circle GetCollisionCircle()

Returns

Circle

Hover(Point)

Called when the user is hovering above a point on the screen.

public override void Hover(Point target)

Parameters

target Point

The point the user is hovering over in pixels.

Initialize()

Generate Terrain and Renderables from Positionables and keeps everything in sync using events

public override void Initialize()

Remarks

Should be called before HookIn() is used

Exceptions

FileNotFoundException

A required Asset file could not be found.

IOException

There was an error reading an Asset file.

InvalidDataException

An Asset file contains invalid data.

MovePositionables(IEnumerable<Positionable<Vector2>>, Vector2)

Informs observers that one or more Positionable<TCoordinates>s are to be moved to a new position.

protected override void MovePositionables(IEnumerable<Positionable<Vector2>> positionables, Vector2 target)

Parameters

positionables IEnumerable<Positionable<Vector2>>

The Positionable<TCoordinates>s to be moved.

target Vector2

The terrain position to move the positionables to.

Remarks

This replaces InteractivePresenters pathfinding based movement with a callback event.

RegisterRenderablesSync()

Hook to configure RenderablesSync and LightsSync.

protected override void RegisterRenderablesSync()

Events

PostionableMove

Occurs when an Positionable<TCoordinates> is to be moved.

public event PostionableMoveHandler PostionableMove

Event Type

PostionableMoveHandler

TerrainPaint

Occurs when the user selects an area while TerrainBrush is set to a value other than null. Passes the coordinates in world space.

public event TerrainPaint TerrainPaint

Event Type

TerrainPaint