Frame of Reference Game API  1.0.3
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | List of all members
FrameOfReference.World.Universe Class Reference

Represents a world with a height-map based Terrain. More...

Inheritance diagram for FrameOfReference.World.Universe:

Public Member Functions

 Universe (Terrain< TerrainTemplate > terrain)
 Creates a new Universe with a terrain. More...
 
override void Update (double elapsedGameTime)
 
Entity GetEntity (string name)
 Retrieves an Entity from Positionables by its name. More...
 
Trigger GetTrigger (string name)
 Retrieves an Trigger from Positionables by its name. More...
 
CameraState< Vector2 > GetCamera (string name)
 Retrieves an CameraState<TCoordinates> from Positionables by its name. More...
 
void PlayerMove (Entity entity, Vector2 target)
 Makes a player-controlled Entity move towards a target . More...
 
void MakePlayerControlled (string name)
 Turns a specific Entity into a player-controlled character. More...
 
void MakeAllNpc ()
 Turns all Entitys into NPCs. More...
 
void UnwrapWaypoints ()
 Moves Waypoint from Entity.Waypoints to UniverseBase<TCoordinates>.Positionables. Call to prepare for editing. More...
 
 Universe ()
 Base-constructor for XML serialization. Do not call manually! More...
 
override void Save (string path)
 

Static Public Member Functions

static Universe Load (string path)
 Loads a Universe from a compressed XML file (map file). More...
 
static Universe FromContent (string id)
 Loads a Universe from the game content source via the ContentManager. More...
 

Public Attributes

override MonitoredCollection< Positionable< Vector2 > > Positionables => _positionables
 
const string FileExt = "." + GeneralSettings.AppNameShort + "Map"
 The file extensions when this class is stored as a file. More...
 

Protected Member Functions

override void Update (IUpdateable updateable, double elapsedGameTime)
 

Properties

Terrain< TerrainTemplateTerrain [get, set]
 The Terrain on which Entitys are placed. More...
 
float LightPhase [get, set]
 A value between 0 and 4 representing the current sun and moon positions. (0 = dawn, 1 = noon, 2 = dusk, 3 = midnight) More...
 
float LightPhaseSpeedFactor = 1 / 40f [get, set]
 The speed with which the LightPhase is incremented. More...
 
Color AmbientColor [get, set]
 The color of the ambient light (background light that is always visible and has no direction). More...
 
XColor AmbientColorValue [get, set]
 Used for XML serialization. More...
 
Color SunColor [get, set]
 The color of the diffuse light (normal directional light) of the sun. More...
 
XColor SunColorValue [get, set]
 Used for XML serialization. More...
 
float SunInclination [get, set]
 The angle of inclination of the sun's path away from the horizon towards south in degrees. More...
 
Color MoonColor [get, set]
 The color of the diffuse light (normal directional light) of the second moon. More...
 
XColor MoonColorValue [get, set]
 Used for XML serialization. More...
 
float MoonInclination [get, set]
 The angle of inclination of the second moon's path away from the horizon towards south in degrees. More...
 
ColorCorrection ColorCorrectionDawn [get, set]
 Color correction values to apply at dawn. More...
 
ColorCorrection ColorCorrectionNoon [get, set]
 Color correction values to apply at noon. More...
 
ColorCorrection ColorCorrectionDusk [get, set]
 Color correction values to apply at dusk. More...
 
ColorCorrection ColorCorrectionMidnight [get, set]
 Color correction values to apply at midnight. More...
 
bool Fog [get, set]
 Is the fog active? More...
 
float FogDistance [get, set]
 The maximum distance one can look through the fog. More...
 
Color FogColor [get, set]
 The color of the fog. More...
 
XColor FogColorValue [get, set]
 Used for XML serialization. More...
 
bool Bleach [get, set]
 Is the fog active? More...
 
int MaxTraversableSlope [get, set]
 The maximum slope the IPathfinder<TCoordinates> considers traversable. More...
 
Terrain< TerrainTemplateTerrainSerialize [get, set]
 Used for XML serialization. More...
 

Events

Action LightingChanged
 Occurs when LightPhase, AmbientColor, SunColor, ColorCorrectionDawn, ColorCorrectionNoon or ColorCorrectionDusk, ColorCorrectionMidnight was changed. More...
 

Detailed Description

Represents a world with a height-map based Terrain.

Constructor & Destructor Documentation

◆ Universe() [1/2]

FrameOfReference.World.Universe.Universe ( Terrain< TerrainTemplate terrain)
inline

Creates a new Universe with a terrain.

Parameters
terrainThe terrain for the new Universe.

◆ Universe() [2/2]

FrameOfReference.World.Universe.Universe ( )
inline

Base-constructor for XML serialization. Do not call manually!

Member Function Documentation

◆ FromContent()

static Universe FrameOfReference.World.Universe.FromContent ( string  id)
inlinestatic

Loads a Universe from the game content source via the ContentManager.

Parameters
idThe ID of the Universe to load.
Returns
The loaded Universe.

◆ GetCamera()

CameraState<Vector2> FrameOfReference.World.Universe.GetCamera ( string  name)
inline

Retrieves an CameraState<TCoordinates> from Positionables by its name.

Returns
The first matching CameraState<TCoordinates>; null if there is no match.

◆ GetEntity()

Entity FrameOfReference.World.Universe.GetEntity ( string  name)
inline

Retrieves an Entity from Positionables by its name.

Returns
The first matching Entity; null if there is no match.

◆ GetTrigger()

Trigger FrameOfReference.World.Universe.GetTrigger ( string  name)
inline

Retrieves an Trigger from Positionables by its name.

Returns
The first matching Trigger; null if there is no match.

◆ Load()

static Universe FrameOfReference.World.Universe.Load ( string  path)
inlinestatic

Loads a Universe from a compressed XML file (map file).

Parameters
pathThe file to load from.
Returns
The loaded Universe.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidOperationExceptionA problem occurred while deserializing the XML data.

◆ MakeAllNpc()

void FrameOfReference.World.Universe.MakeAllNpc ( )
inline

Turns all Entitys into NPCs.

◆ MakePlayerControlled()

void FrameOfReference.World.Universe.MakePlayerControlled ( string  name)
inline

Turns a specific Entity into a player-controlled character.

◆ PlayerMove()

void FrameOfReference.World.Universe.PlayerMove ( Entity  entity,
Vector2  target 
)
inline

Makes a player-controlled Entity move towards a target .

◆ UnwrapWaypoints()

void FrameOfReference.World.Universe.UnwrapWaypoints ( )
inline

Moves Waypoint from Entity.Waypoints to UniverseBase<TCoordinates>.Positionables. Call to prepare for editing.

Member Data Documentation

◆ FileExt

const string FrameOfReference.World.Universe.FileExt = "." + GeneralSettings.AppNameShort + "Map"

The file extensions when this class is stored as a file.

Property Documentation

◆ AmbientColor

Color FrameOfReference.World.Universe.AmbientColor
getset

The color of the ambient light (background light that is always visible and has no direction).

Is not serialized/stored, AmbientColorValue is used for that.

◆ AmbientColorValue

XColor FrameOfReference.World.Universe.AmbientColorValue
getset

Used for XML serialization.

See also
AmbientColor

◆ Bleach

bool FrameOfReference.World.Universe.Bleach
getset

Is the fog active?

◆ ColorCorrectionDawn

ColorCorrection FrameOfReference.World.Universe.ColorCorrectionDawn
getset

Color correction values to apply at dawn.

◆ ColorCorrectionDusk

ColorCorrection FrameOfReference.World.Universe.ColorCorrectionDusk
getset

Color correction values to apply at dusk.

◆ ColorCorrectionMidnight

ColorCorrection FrameOfReference.World.Universe.ColorCorrectionMidnight
getset

Color correction values to apply at midnight.

◆ ColorCorrectionNoon

ColorCorrection FrameOfReference.World.Universe.ColorCorrectionNoon
getset

Color correction values to apply at noon.

◆ Fog

bool FrameOfReference.World.Universe.Fog
getset

Is the fog active?

◆ FogColor

Color FrameOfReference.World.Universe.FogColor
getset

The color of the fog.

Is not serialized/stored, FogColorValue is used for that.

◆ FogColorValue

XColor FrameOfReference.World.Universe.FogColorValue
getset

Used for XML serialization.

See also
FogColor

◆ FogDistance

float FrameOfReference.World.Universe.FogDistance
getset

The maximum distance one can look through the fog.

◆ LightPhase

float FrameOfReference.World.Universe.LightPhase
getset

A value between 0 and 4 representing the current sun and moon positions. (0 = dawn, 1 = noon, 2 = dusk, 3 = midnight)

◆ LightPhaseSpeedFactor

float FrameOfReference.World.Universe.LightPhaseSpeedFactor = 1 / 40f
getset

The speed with which the LightPhase is incremented.

◆ MaxTraversableSlope

int FrameOfReference.World.Universe.MaxTraversableSlope
getset

The maximum slope the IPathfinder<TCoordinates> considers traversable.

◆ MoonColor

Color FrameOfReference.World.Universe.MoonColor
getset

The color of the diffuse light (normal directional light) of the second moon.

Is not serialized/stored, MoonColorValue is used for that.

◆ MoonColorValue

XColor FrameOfReference.World.Universe.MoonColorValue
getset

Used for XML serialization.

See also
MoonColor

◆ MoonInclination

float FrameOfReference.World.Universe.MoonInclination
getset

The angle of inclination of the second moon's path away from the horizon towards south in degrees.

◆ SunColor

Color FrameOfReference.World.Universe.SunColor
getset

The color of the diffuse light (normal directional light) of the sun.

Is not serialized/stored, SunColorValue is used for that.

◆ SunColorValue

XColor FrameOfReference.World.Universe.SunColorValue
getset

Used for XML serialization.

See also
SunColor

◆ SunInclination

float FrameOfReference.World.Universe.SunInclination
getset

The angle of inclination of the sun's path away from the horizon towards south in degrees.

◆ Terrain

Terrain<TerrainTemplate> FrameOfReference.World.Universe.Terrain
getset

The Terrain on which Entitys are placed.

Exceptions
InvalidOperationExceptionThe Terrain could not be properly loaded from the file.

Is not serialized/stored, TerrainSerialize is used for that.

◆ TerrainSerialize

Terrain<TerrainTemplate> FrameOfReference.World.Universe.TerrainSerialize
getset

Used for XML serialization.

Event Documentation

◆ LightingChanged

Action FrameOfReference.World.Universe.LightingChanged

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