Interface IUniverse
- Namespace
- AlphaFramework.World
- Assembly
- AlphaFramework.World.dll
A game world (but not a running game). Equivalent to the content of a map file.
public interface IUniverse
Properties
GameTime
Total elapsed game time in seconds.
double GameTime { get; set; }
Property Value
SourceFile
The map file this universe was originally loaded from, if any.
string? SourceFile { get; }
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.
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.
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.
void Update(double elapsedGameTime)
Parameters
elapsedGameTimedoubleHow much game time in seconds has elapsed since this method was last called.