Table of Contents

Class UniverseBase

Namespace
AlphaFramework.World
Assembly
AlphaFramework.World.dll

A common base for game worlds (but not a running game). Equivalent to the content of a map file.

public abstract class UniverseBase : IUniverse
Inheritance
object
UniverseBase
Implements
Derived
CoordinateUniverse<TCoordinates>

Properties

GameTime

Total elapsed game time in seconds.

public double GameTime { get; set; }

Property Value

double

Skybox

The name of the skybox to use for this map; may be null or empty.

public string? Skybox { get; set; }

Property Value

string

SourceFile

The map file this universe was originally loaded from, if any.

[Browsable(false)]
public string? SourceFile { get; protected set; }

Property Value

string

Remarks

Should still point to the original map file, even when the universe is embedded inside a savegame.

Methods

PostLoad(string?)

Hook to be called after the universe was deserialized.

public virtual void PostLoad(string? path)

Parameters

path string

The map file this universe was originally loaded from, if any. Should still point to the original map file, even when the universe is embedded inside a savegame.

Save(string)

Saves this CoordinateUniverse<TCoordinates> in a map file.

public virtual void Save(string path)

Parameters

path string

The file to save in.

Exceptions

IOException

A problem occurred while writing the file.

UnauthorizedAccessException

Write access to the file is not permitted.

Update(double)

Updates the universe.

public virtual void Update(double elapsedGameTime)

Parameters

elapsedGameTime double

How much game time in seconds has elapsed since this method was last called.

Events

SkyboxChanged

Occurs when Skybox was changed.

public event Action? SkyboxChanged

Event Type

Action