Table of Contents

Class PresenterBase<TUniverse, TCoordinates>

Namespace
AlphaFramework.Presentation
Assembly
AlphaFramework.Presentation.dll

Uses the Engine to present an IUniverse game world.

public abstract class PresenterBase<TUniverse, TCoordinates> : IDisposable where TUniverse : UniverseBase<TCoordinates> where TCoordinates : struct

Type Parameters

TUniverse

The type of IUniverse to present.

TCoordinates

Data type for storing position coordinates of objects in the game world.

Inheritance
PresenterBase<TUniverse, TCoordinates>
Implements
Derived
Inherited Members
Extension Methods

Constructors

PresenterBase(Engine, TUniverse)

Creates a new presenter.

protected PresenterBase(Engine engine, TUniverse universe)

Parameters

engine Engine

The engine to use for rendering.

universe TUniverse

The game world to present.

Fields

Engine

The Engine reference to use for rendering operations

protected readonly Engine Engine

Field Value

Engine

LightsSync

Maps between Positionables and Lights.

protected readonly ModelViewSync<Positionable<TCoordinates>, LightSource> LightsSync

Field Value

ModelViewSync<Positionable<TCoordinates>, LightSource>

RenderablesSync

Maps between Positionables and Positionables.

protected readonly ModelViewSync<Positionable<TCoordinates>, PositionableRenderable> RenderablesSync

Field Value

ModelViewSync<Positionable<TCoordinates>, PositionableRenderable>

Scene

The engine scene containing the graphical representations of Positionable<TCoordinates>s

protected readonly Scene Scene

Field Value

Scene

Properties

Disposed

Was this presenter already disposed?

[Browsable(false)]
public bool Disposed { get; }

Property Value

bool

Initialized

Was Initialize() already called?

public bool Initialized { get; protected set; }

Property Value

bool

Universe

The game world to present.

[LuaHide]
public TUniverse Universe { get; }

Property Value

TUniverse

View

The engine view used to display the Scene

public View View { get; protected set; }

Property Value

View

Methods

DimDown()

Dims in the screen down.

public virtual void DimDown()

DimUp()

Dims in the screen back up.

public virtual void DimUp()

Dispose()

Removes the Universe hooks setup by Initialize() and disposes all created Views, Scenes, PositionableRenderables, etc.

public void Dispose()

Dispose(bool)

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

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true if called manually and not by the garbage collector.

~PresenterBase()

protected ~PresenterBase()

HookIn()

Hooks the View into Views

public virtual void HookIn()

Remarks

Will internally call Initialize() first, if you didn't

HookOut()

Hooks the View out of Views

public virtual void HookOut()

Initialize()

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

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

RegisterRenderablesSync()

Hook to configure RenderablesSync and LightsSync.

protected virtual void RegisterRenderablesSync()