Table of Contents

Class InteractivePresenter

Namespace
FrameOfReference.Presentation
Assembly
FrameOfReference.Presentation.dll

Handles the visual representation of FrameOfReference.World content where the user can manually control the perspective

public abstract class InteractivePresenter : Presenter, IDisposable, IInputReceiver
Inheritance
InteractivePresenter
Implements
Derived
Inherited Members
Extension Methods

Constructors

InteractivePresenter(Engine, Universe)

Creates a new interactive presenter

protected InteractivePresenter(Engine engine, Universe universe)

Parameters

engine Engine

The engine to use for rendering

universe Universe

The universe to display

Properties

SelectedPositionables

The Positionable<TCoordinates>s the user has selected with the mouse

public MonitoredCollection<Positionable<Vector2>> SelectedPositionables { get; }

Property Value

MonitoredCollection<Positionable<Vector2>>

Methods

AreaSelection(Rectangle, bool, bool)

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

public virtual 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 virtual 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).

Dispose(bool)

To be called by Dispose() and the object destructor.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if called manually and not by the garbage collector.

DoubleClick(MouseEventArgs)

Called when the user double-clicked something.

public virtual void DoubleClick(MouseEventArgs e)

Parameters

e MouseEventArgs

The original event arguments from the click.

Hover(Point)

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

public virtual 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)

Moves one or more Positionable<TCoordinates>s to a new position.

protected abstract 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.

PerspectiveChange(Point, int, int)

Called when the user changes the view perspective.

public void PerspectiveChange(Point pan, int rotation, int zoom)

Parameters

pan Point

Horizontal XY-panning in pixels.

rotation int

Horizontal rotation in pixels.

zoom int

Vertical zooming in pixels. Greater than 0 to zoom in; less than 0 to zoom out.

PickPositionables(IEnumerable<Positionable<Vector2>>, bool)

protected virtual void PickPositionables(IEnumerable<Positionable<Vector2>> positionables, bool accumulate)

Parameters

positionables IEnumerable<Positionable<Vector2>>

The selected Positionable<TCoordinates>s.

accumulate bool

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

SwingCameraTo(CameraState<Vector2>?)

Switches from the current camera view to a new view using a cinematic effect.

public void SwingCameraTo(CameraState<Vector2>? cameraState = null)

Parameters

cameraState CameraState<Vector2>

The destination state of the camera; null for default (looking at the center of the terrain).

SwingCameraTo(PositionableRenderable)

Swings the camera to look at a specifc PositionableRenderable.

public void SwingCameraTo(PositionableRenderable target)

Parameters

target PositionableRenderable

SwingCameraTo(Vector2)

Swings the camera to look at a specifc set of 2D coordinates.

public void SwingCameraTo(Vector2 target)

Parameters

target Vector2

TakeOverSelection()

Turns all currently selected Entitys into player-controlled characters.

public void TakeOverSelection()