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
-
objectUniverseBase
- Implements
- Derived
-
CoordinateUniverse<TCoordinates>
Properties
GameTime
Total elapsed game time in seconds.
public double GameTime { get; set; }
Property Value
Skybox
The name of the skybox to use for this map; may be null or empty.
public string? Skybox { get; set; }
Property Value
SourceFile
The map file this universe was originally loaded from, if any.
[Browsable(false)]
public string? SourceFile { get; protected set; }
Property Value
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
pathstringThe 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
pathstringThe 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
elapsedGameTimedoubleHow much game time in seconds has elapsed since this method was last called.
Events
SkyboxChanged
Occurs when Skybox was changed.
public event Action? SkyboxChanged