Barotrauma Client
Loading...
Searching...
No Matches
Barotrauma.GameSession Class Reference

Public Types

enum  InfoFrameTab { Crew , Mission , MyCharacter , Traitor }
 

Public Member Functions

 GameSession (SubmarineInfo submarineInfo, string savePath, GameModePreset gameModePreset, CampaignSettings settings, string? seed=null, MissionType missionType=MissionType.None)
 Start a new GameSession. Will be saved to the specified save path (if playing a game mode that can be saved).
 
 GameSession (SubmarineInfo submarineInfo, GameModePreset gameModePreset, string? seed=null, IEnumerable< MissionPrefab >? missionPrefabs=null)
 Start a new GameSession with a specific pre-selected mission.
 
 GameSession (SubmarineInfo submarineInfo, List< SubmarineInfo > ownedSubmarines, XDocument doc, string saveFile)
 Load a game session from the specified XML document. The session will be saved to the specified path.
 
void LoadPreviousSave ()
 
void SwitchSubmarine (SubmarineInfo newSubmarine, bool transferItems, Client? client=null)
 Switch to another submarine. The sub is loaded when the next round starts.
 
bool TryPurchaseSubmarine (SubmarineInfo newSubmarine, Client? client=null)
 
bool IsSubmarineOwned (SubmarineInfo query)
 
bool IsCurrentLocationRadiated ()
 
void StartRound (string levelSeed, float? difficulty=null, LevelGenerationParams? levelGenerationParams=null)
 
void StartRound (LevelData? levelData, bool mirrorLevel=false, SubmarineInfo? startOutpost=null, SubmarineInfo? endOutpost=null)
 
void PlaceSubAtStart (Level? level)
 
void Update (float deltaTime)
 
MissionGetMission (int index)
 
int GetMissionIndex (Mission mission)
 
void EnforceMissionOrder (List< Identifier > missionIdentifiers)
 
void EndRound (string endMessage, CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None, TraitorManager.TraitorResults? traitorResults=null)
 
void LogEndRoundStats (string eventId, TraitorManager.TraitorResults? traitorResults=null)
 
void KillCharacter (Character character)
 
void ReviveCharacter (Character character)
 
void Save (string filePath)
 

Static Public Member Functions

static Location[] CreateDummyLocations (LevelData levelData, LocationType? forceLocationType=null)
 
static Location[] CreateDummyLocations (string seed, LocationType? forceLocationType=null)
 
static ImmutableHashSet< CharacterGetSessionCrewCharacters (CharacterType type)
 Returns a list of crew characters currently in the game with a given filter.
 
static bool IsCompatibleWithEnabledContentPackages (IList< string > contentPackageNames, out LocalizedString errorMsg)
 

Public Attributes

readonly EventManager EventManager
 
GameModeGameMode
 
CrewManagerCrewManager
 
double TimeSpentCleaning
 
double TimeSpentPainting
 
CharacterTeamTypeWinningTeam
 
List< SubmarineInfoOwnedSubmarines = new List<SubmarineInfo>()
 

Properties

Version LastSaveVersion = GameMain.Version [get, set]
 
float RoundDuration [get]
 
IEnumerable< MissionMissions [get]
 
IEnumerable< CharacterCasualties [get]
 
bool IsRunning [get]
 
bool RoundEnding [get]
 
LevelLevel [get]
 
LevelDataLevelData [get]
 
bool MirrorLevel [get]
 
MapMap [get]
 
CampaignModeCampaign [get]
 
Location StartLocation [get]
 
Location EndLocation [get]
 
SubmarineInfo SubmarineInfo [get, set]
 
SubmarineSubmarine [get, set]
 
string? SavePath [get, set]
 
bool TraitorsEnabled [get]
 

Member Enumeration Documentation

◆ InfoFrameTab

Enumerator
Crew 
Mission 
MyCharacter 
Traitor 

Constructor & Destructor Documentation

◆ GameSession() [1/3]

Barotrauma.GameSession.GameSession ( SubmarineInfo submarineInfo,
string savePath,
GameModePreset gameModePreset,
CampaignSettings settings,
string? seed = null,
MissionType missionType = MissionType::None )

Start a new GameSession. Will be saved to the specified save path (if playing a game mode that can be saved).

◆ GameSession() [2/3]

Barotrauma.GameSession.GameSession ( SubmarineInfo submarineInfo,
GameModePreset gameModePreset,
string? seed = null,
IEnumerable< MissionPrefab >? missionPrefabs = null )

Start a new GameSession with a specific pre-selected mission.

◆ GameSession() [3/3]

Barotrauma.GameSession.GameSession ( SubmarineInfo submarineInfo,
List< SubmarineInfo > ownedSubmarines,
XDocument doc,
string saveFile )

Load a game session from the specified XML document. The session will be saved to the specified path.

Member Function Documentation

◆ CreateDummyLocations() [1/2]

static Location[] Barotrauma.GameSession.CreateDummyLocations ( LevelData levelData,
LocationType? forceLocationType = null )
static

◆ CreateDummyLocations() [2/2]

static Location[] Barotrauma.GameSession.CreateDummyLocations ( string seed,
LocationType? forceLocationType = null )
static

◆ EndRound()

void Barotrauma.GameSession.EndRound ( string endMessage,
CampaignMode.TransitionType transitionType = CampaignMode::TransitionType::None,
TraitorManager.TraitorResults? traitorResults = null )

◆ EnforceMissionOrder()

void Barotrauma.GameSession.EnforceMissionOrder ( List< Identifier > missionIdentifiers)

◆ GetMission()

Mission? Barotrauma.GameSession.GetMission ( int index)

◆ GetMissionIndex()

int Barotrauma.GameSession.GetMissionIndex ( Mission mission)

◆ GetSessionCrewCharacters()

static ImmutableHashSet< Character > Barotrauma.GameSession.GetSessionCrewCharacters ( CharacterType type)
static

Returns a list of crew characters currently in the game with a given filter.

Parameters
typeCharacter type filter
Returns

In singleplayer mode the CharacterType.Player returns the currently controlled player.

◆ IsCompatibleWithEnabledContentPackages()

static bool Barotrauma.GameSession.IsCompatibleWithEnabledContentPackages ( IList< string > contentPackageNames,
out LocalizedString errorMsg )
static

◆ IsCurrentLocationRadiated()

bool Barotrauma.GameSession.IsCurrentLocationRadiated ( )

◆ IsSubmarineOwned()

bool Barotrauma.GameSession.IsSubmarineOwned ( SubmarineInfo query)

◆ KillCharacter()

void Barotrauma.GameSession.KillCharacter ( Character character)

◆ LoadPreviousSave()

void Barotrauma.GameSession.LoadPreviousSave ( )

◆ LogEndRoundStats()

void Barotrauma.GameSession.LogEndRoundStats ( string eventId,
TraitorManager.TraitorResults? traitorResults = null )

◆ PlaceSubAtStart()

void Barotrauma.GameSession.PlaceSubAtStart ( Level? level)

◆ ReviveCharacter()

void Barotrauma.GameSession.ReviveCharacter ( Character character)

◆ Save()

void Barotrauma.GameSession.Save ( string filePath)

◆ StartRound() [1/2]

void Barotrauma.GameSession.StartRound ( LevelData? levelData,
bool mirrorLevel = false,
SubmarineInfo? startOutpost = null,
SubmarineInfo? endOutpost = null )

◆ StartRound() [2/2]

void Barotrauma.GameSession.StartRound ( string levelSeed,
float? difficulty = null,
LevelGenerationParams? levelGenerationParams = null )

◆ SwitchSubmarine()

void Barotrauma.GameSession.SwitchSubmarine ( SubmarineInfo newSubmarine,
bool transferItems,
Client? client = null )

Switch to another submarine. The sub is loaded when the next round starts.

◆ TryPurchaseSubmarine()

bool Barotrauma.GameSession.TryPurchaseSubmarine ( SubmarineInfo newSubmarine,
Client? client = null )

◆ Update()

void Barotrauma.GameSession.Update ( float deltaTime)

Member Data Documentation

◆ CrewManager

CrewManager? Barotrauma.GameSession.CrewManager

◆ EventManager

readonly EventManager Barotrauma.GameSession.EventManager

◆ GameMode

GameMode? Barotrauma.GameSession.GameMode

◆ OwnedSubmarines

List<SubmarineInfo> Barotrauma.GameSession.OwnedSubmarines = new List<SubmarineInfo>()

◆ TimeSpentCleaning

double Barotrauma.GameSession.TimeSpentCleaning

◆ TimeSpentPainting

double Barotrauma.GameSession.TimeSpentPainting

◆ WinningTeam

CharacterTeamType? Barotrauma.GameSession.WinningTeam

Property Documentation

◆ Campaign

CampaignMode? Barotrauma.GameSession.Campaign
get

◆ Casualties

IEnumerable<Character> Barotrauma.GameSession.Casualties
get

◆ EndLocation

Location Barotrauma.GameSession.EndLocation
get

◆ IsRunning

bool Barotrauma.GameSession.IsRunning
get

◆ LastSaveVersion

Version Barotrauma.GameSession.LastSaveVersion = GameMain.Version
getset

◆ Level

Level? Barotrauma.GameSession.Level
get

◆ LevelData

LevelData? Barotrauma.GameSession.LevelData
get

◆ Map

Map? Barotrauma.GameSession.Map
get

◆ MirrorLevel

bool Barotrauma.GameSession.MirrorLevel
get

◆ Missions

IEnumerable<Mission> Barotrauma.GameSession.Missions
get

◆ RoundDuration

float Barotrauma.GameSession.RoundDuration
get

◆ RoundEnding

bool Barotrauma.GameSession.RoundEnding
get

◆ SavePath

string? Barotrauma.GameSession.SavePath
getset

◆ StartLocation

Location Barotrauma.GameSession.StartLocation
get

◆ Submarine

Submarine? Barotrauma.GameSession.Submarine
getset

◆ SubmarineInfo

SubmarineInfo Barotrauma.GameSession.SubmarineInfo
getset

◆ TraitorsEnabled

bool Barotrauma.GameSession.TraitorsEnabled
get

The documentation for this class was generated from the following file: