User:Aliser/Game's call stacks

From Cosmoteer Wiki
Jump to navigation Jump to search

This page lists some of the game's call stacks, which might be useful in understanding what is going on and in what order.

Main loop

Reference Class/member Class/member description Commentary
Cosmoteer.GameApp private static void Main(string[] args) The main application entry point.
Halfling.Application.Bases.GenericApp public void ApplicationMain(string[] args) Should be called immediately after constructing the GenericApp object to run the application.
Halfling.Application.Bases.GenericApp protected IEnumerable<ApplicationMainIterationResult> ApplicationMainIterator() Returns the iterator that when looped through runs the application.
Halfling.Application.Bases.GenericApp protected virtual IEnumerable<ApplicationMainIterationResult> GetRunIterator() Returns an iterator that runs the game as it is looped through.
Halfling.Application.Director public IEnumerable<ApplicationMainIterationResult> GetRunIterator(IAppState state) Returns an iterator that runs the application as it is looped through.
Halfling.Application.Director public IEnumerable<ApplicationMainIterationResult> GetRunIterator() Returns an iterator that runs the application as it is looped through.
Halfling.Application.Director private void DoUpdate() Performs update-related game loop tasks.
Halfling.Application.Director private void CallUpdate() Calls the Update method on the top state.
Halfling.Application.AppStateEx void IAppState.Update(Action updateParent) Called when the application should update its logic.

<param name="updateParent">Invoke this delegate to call the parent state's Update method.</param>

Cosmoteer.Data.Assets protected override void Update(Action updateParent) Called when the application should update its logic.

<param name="updateParent">Invoke this delegate to call the parent state's Update method.</param>

First Cosmoteer entry point.

Loading into a level

Reference Class/member Class/member description Commentary
Cosmoteer.Data.Assets private async void OnFinishedLoading() Called when the game has finished loading.
Cosmoteer.Modes.Career.CareerInit public override GameRoot CreateGame(NetManagerFactory netManager) Creates the GameRoot for the multiplayer session. *not only the multiplayer session, single player career too.
Cosmoteer.Game.GameRoot public GameRoot(GameModeFactory gameMode, NetManagerFactory netManager) Creates a new GameRoot using the specified GameModeManager. Seems to be called when loading into level (career, sandbox, etc.)
Cosmoteer.Modes.GameModeManager public virtual SimRoot CreateSimRootForNode(MapNode mapNode) Creates and initializes a SimRoot that corresponds to the specified MapNode.
Cosmoteer.Modes.Career.CareerGameModeManager public override void FinishInitNewGame() Called after the galaxy map and initial simulation are created to finish initializing a new game.
Cosmoteer.Ships.Ship public static Ship Load( byte[] bytes, string shipName, int playerIndex = 0, bool blueprintsOnly = false, bool centerOnZero = false, bool spawnWithCrew = true, bool initializeToMax = false, bool builtByPlayer = false, ulong? randSeed = null, ObjectID id = default (ObjectID)) Creates a new ship loaded from the specified byte array.