AlphaFramework API  1.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates > Class Template Reference

Uses the Engine to present an IUniverse game world. More...

Inheritance diagram for AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >:

Public Member Functions

virtual void Initialize ()
 Generate Terrain and Renderables from UniverseBase<TCoordinates>.Positionables and keeps everything in sync using events More...
 
virtual void HookIn ()
 Hooks the View into OmegaEngine.Engine.Views More...
 
virtual void HookOut ()
 Hooks the View out of OmegaEngine.Engine.Views More...
 
virtual void DimDown ()
 Dims in the screen down. More...
 
virtual void DimUp ()
 Dims in the screen back up. More...
 
void Dispose ()
 Removes the Universe hooks setup by Initialize and disposes all created Views, Scenes, PositionableRenderables, etc. More...
 

Protected Member Functions

 PresenterBase (Engine engine, TUniverse universe)
 Creates a new presenter. More...
 
virtual void RegisterRenderablesSync ()
 Hook to configure RenderablesSync and LightsSync. More...
 
virtual void Dispose (bool disposing)
 To be called by IDisposable.Dispose and the object destructor. More...
 

Protected Attributes

readonly ModelViewSync< Positionable< TCoordinates >, PositionableRenderableRenderablesSync
 Maps between UniverseBase<TCoordinates>.Positionables and OmegaEngine.Graphics.Scene.Positionables. More...
 
readonly ModelViewSync< Positionable< TCoordinates >, LightSourceLightsSync
 Maps between UniverseBase<TCoordinates>.Positionables and OmegaEngine.Graphics.Scene.Lights. More...
 
readonly Engine Engine
 The Engine reference to use for rendering operations More...
 
readonly Scene Scene
 The engine scene containing the graphical representations of Positionable<TCoordinates>s More...
 

Properties

View View [get, protected set]
 The engine view used to display the Scene More...
 
TUniverse Universe [get]
 The game world to present. More...
 
bool Initialized [get, protected set]
 Was Initialize already called? More...
 
bool Disposed [get]
 Was this presenter already disposed? More...
 

Detailed Description

Uses the Engine to present an IUniverse game world.

Template Parameters
TUniverseThe type of IUniverse to present.
TCoordinatesData type for storing position coordinates of objects in the game world.
Type Constraints
TUniverse :UniverseBase<TCoordinates> 
TCoordinates :struct 

Constructor & Destructor Documentation

◆ PresenterBase()

AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.PresenterBase ( Engine  engine,
TUniverse  universe 
)
inlineprotected

Creates a new presenter.

Parameters
engineThe engine to use for rendering.
universeThe game world to present.

Member Function Documentation

◆ DimDown()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.DimDown ( )
inlinevirtual

Dims in the screen down.

◆ DimUp()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.DimUp ( )
inlinevirtual

Dims in the screen back up.

◆ Dispose() [1/2]

void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Dispose ( )
inline

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

◆ Dispose() [2/2]

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Dispose ( bool  disposing)
inlineprotectedvirtual

To be called by IDisposable.Dispose and the object destructor.

Parameters
disposingtrue if called manually and not by the garbage collector.

◆ HookIn()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.HookIn ( )
inlinevirtual

Hooks the View into OmegaEngine.Engine.Views

Will internally call Initialize first, if you didn't

◆ HookOut()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.HookOut ( )
inlinevirtual

Hooks the View out of OmegaEngine.Engine.Views

◆ Initialize()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Initialize ( )
inlinevirtual

Generate Terrain and Renderables from UniverseBase<TCoordinates>.Positionables and keeps everything in sync using events

Exceptions
FileNotFoundExceptionA required Asset file could not be found.
IOExceptionThere was an error reading an Asset file.
InvalidDataExceptionAn Asset file contains invalid data.

Should be called before HookIn is used

◆ RegisterRenderablesSync()

virtual void AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.RegisterRenderablesSync ( )
inlineprotectedvirtual

Hook to configure RenderablesSync and LightsSync.

Member Data Documentation

◆ Engine

readonly Engine AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Engine
protected

The Engine reference to use for rendering operations

◆ LightsSync

readonly ModelViewSync<Positionable<TCoordinates>, LightSource> AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.LightsSync
protected

Maps between UniverseBase<TCoordinates>.Positionables and OmegaEngine.Graphics.Scene.Lights.

◆ RenderablesSync

readonly ModelViewSync<Positionable<TCoordinates>, PositionableRenderable> AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.RenderablesSync
protected

Maps between UniverseBase<TCoordinates>.Positionables and OmegaEngine.Graphics.Scene.Positionables.

◆ Scene

readonly Scene AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Scene
protected

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

Property Documentation

◆ Disposed

bool AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Disposed
get

Was this presenter already disposed?

◆ Initialized

bool AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Initialized
getprotected set

Was Initialize already called?

◆ Universe

TUniverse AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.Universe
get

The game world to present.

◆ View

View AlphaFramework.Presentation.PresenterBase< TUniverse, TCoordinates >.View
getprotected set

The engine view used to display the Scene


The documentation for this class was generated from the following file: