GameLogic Class

From KitHack Model Club Wiki
Jump to navigation Jump to search

Back to SDK API Reference

GameLogic Class

The `GameLogic` class manages the core game logic, including the handling of scenes, player data, and multiplayer sessions. It also provides various utility functions and properties for interacting with game settings and states.

Public Constant Fields

  • `public static string IssueTrackerURL` - The URL for the issue tracker.

Public Fields

  • `public static GameLogic Instance` - The singleton instance of the `GameLogic` class.
  • `public static List<string> pauseReqs` - A list of pause requests.
  • `public static CraftInfo CraftToLoad { get; set; }` - The craft to load.
  • `public static string MissionFileToLoad { get; set; }` - The mission file to load.
  • `public static int SceneryToLoad { get; set; }` - The scenery to load.
  • `public static MPSessionInfo mpInfo { get; set; }` - The multiplayer session information.
  • `public static MPMode MpMode { get; set; }` - The multiplayer mode.
  • `public static GameLogic.SpawnLocation SpawnLocationOverride { get; set; }` - The spawn location override.

Public Properties

  • `public static List<CraftInfo> CraftList` - Gets the list of crafts.
  • `public static SceneryInfo LoadedSceneryInfo` - Gets the loaded scenery information.
  • `public static InputSanityDataSO InputSanity` - Gets the input sanity data.
  • `public static MPMatch mpMatch` - Gets or sets the multiplayer match.
  • `public static GameScenes CurrentScene` - Gets the current scene.
  • `public static bool IsWorkshopScene { get; set; }` - Indicates whether the workshop scene is active.
  • `public static int WorkshopSceneIndex` - Gets the index of the workshop scene.
  • `public static bool IsCareerMode { get; set; }` - Indicates whether the career mode is active.
  • `public static bool StartWithOpenScnEditor { get; set; }` - Indicates whether to start with an open scenario editor.
  • `public static List<PilotInfo> PilotInfosList` - Gets the list of pilot information.
  • `public static PilotInfo PilotInfo { get; set; }` - Gets or sets the pilot information.
  • `public static PilotProfile PilotProfile` - Gets the pilot profile.
  • `public static bool SceneryLoaded` - Indicates whether the scenery is loaded.
  • `public static bool inGame` - Indicates whether the game is in progress.
  • `public static bool Paused` - Gets the pause state.
  • `public static Player LocalPlayer` - Gets the local player.
  • `public static Vehicle LocalPlayerVehicle` - Gets the vehicle of the local player.
  • `public static bool IsEditorMode` - Indicates whether the editor mode is active.
  • `public static List<Player> Players` - Gets the list of players.
  • `public static List<Vehicle> Vehicles` - Gets the list of vehicles.

Public Methods

  • `public static CraftInfo UseCraftToLoad()` - Uses the craft to load.
  • `public static CraftInfo RestoreCraftToLoad()` - Restores the craft to load.
  • `public static CraftInfo FindCraftInfo(string cId)` - Finds the craft information by ID.
  • `public static string GetMainCraftSaveFolder()` - Gets the main craft save folder.
  • `public static string GetActiveCareerOwnedCraftFolder()` - Gets the active career owned craft folder.
  • `public static string GetActiveCareerMissionCraftFolder()` - Gets the active career mission craft folder.
  • `public static string GetOwnedCraftFolderForPilot(PilotInfo pilotInfo)` - Gets the owned craft folder for a pilot.
  • `public static string GetMissionCraftFolderForPilot(PilotInfo pilotInfo)` - Gets the mission craft folder for a pilot.
  • `public static string PPId` - Gets the unique identifier for the player.
  • `public static PilotInfo CreateNewPilot()` - Creates a new pilot.
  • `public static void SaveActivePilot()` - Saves the active pilot.
  • `public static void SavePilot(PilotInfo pInfo)` - Saves the specified pilot.
  • `public static void LoadPilots()` - Loads the pilots.
  • `public static void DeletePilot(PilotInfo pInfo)` - Deletes the specified pilot.
  • `public static bool RequestPause(string rqid)` - Requests a pause.
  • `public static bool RemovePauseRequest(string rqid)` - Removes a pause request.
  • `public static void QuitGame()` - Quits the game.
  • `public static void SetLocalPlayer(Player plr)` - Sets the local player.
  • `public static void GoToScene(GameScenes goToScene, System.Action then = null)` - Goes to the specified scene.
  • `public static void ReturnToMenu(bool confirm, System.Action onProceed = null, System.Action onCancel = null)` - Returns to the menu.
  • `public void StartGameWithCurrentSettings(GameLogic.StartGameTransitionMethod transitionMethod = GameLogic.StartGameTransitionMethod.LoadingPopup, float duration = 1f)` - Starts the game with current settings.
  • `public void JoinMatch(MPMatch m, Callback<bool> onResponse)` - Joins the specified match.
  • `public void LeaveMatch(Action<bool> onLeaveMatch = null)` - Leaves the current match.
  • `public void RequestPlayerSpawn()` - Requests a player spawn.

See Also

  • CraftInfo Class
  • SceneryInfo Class
  • InputSanityDataSO Class
  • MPMatch Class
  • MPSessionInfo Class
  • MPMode Enum
  • GameScenes Enum
  • PilotInfo Class
  • PilotProfile Class
  • Player Class
  • Vehicle Class