Barotrauma Client Doc
Barotrauma.SubmarineInfo Class Reference
Inheritance diagram for Barotrauma.SubmarineInfo:

Public Types

enum class  CrewExperienceLevel { Unknown , CrewExperienceLow , CrewExperienceMid , CrewExperienceHigh }
 

Public Member Functions

override string ToString ()
 
 SubmarineInfo ()
 
 SubmarineInfo (string filePath, string hash="", XElement element=null, bool tryLoad=true)
 
 SubmarineInfo (Submarine sub)
 
 SubmarineInfo (SubmarineInfo original)
 
void Reload ()
 
void Dispose ()
 
bool IsVanillaSubmarine ()
 
void StartHashDocTask (XDocument doc)
 
bool HasTag (SubmarineTag tag)
 
void AddTag (SubmarineTag tag)
 
void RemoveTag (SubmarineTag tag)
 
void CheckSubsLeftBehind (XElement element=null)
 
bool IsCrushDepthDefinedInStructures (out float realWorldCrushDepth)
 Calculated from SubmarineElement. Can be used when the sub hasn't been loaded and we can't access Submarine.RealWorldCrushDepth. More...
 
void AddOutpostNPCIdentifierOrTag (Character npc, Identifier idOrTag)
 
void SaveAs (string filePath, System.IO.MemoryStream previewImage=null)
 
int GetPrice (Location location=null, ImmutableHashSet< Character > characterList=null)
 
void CreatePreviewWindow (GUIComponent parent)
 
void CreateSpecsWindow (GUIListBox parent, GUIFont font, bool includeTitle=true, bool includeClass=true, bool includeDescription=false, bool includeCrushDepth=false)
 
readonly record struct PendingSubInfo (SubmarineInfo PendingSub=null, bool StructuresDefineRealWorldCrushDepth=false, float RealWorldCrushDepth=Level.DefaultRealWorldCrushDepth)
 

Static Public Member Functions

static void AddToSavedSubs (SubmarineInfo subInfo)
 
static void RemoveSavedSub (string filePath)
 
static void RefreshSavedSub (string filePath)
 
static void RefreshSavedSubs ()
 
static XDocument OpenFile (string file)
 
static XDocument OpenFile (string file, out Exception exception)
 
static int GetDefaultTier (int price)
 
static float GetSubCrushDepth (SubmarineInfo subInfo, ref PendingSubInfo pendingSubInfo)
 

Public Attributes

readonly DateTime LastModifiedTime
 
int RecommendedCrewSizeMin = 1
 
CrewExperienceLevel RecommendedCrewExperience
 
HashSet< string > RequiredContentPackages = new HashSet<string>()
 
SubmarineClass SubmarineClass
 
readonly List< ushort > LeftBehindDockingPortIDs = new List<ushort>()
 
readonly List< ushort > BlockedDockingPortIDs = new List<ushort>()
 
OutpostGenerationParams OutpostGenerationParams
 
readonly Dictionary< Identifier, List< Character > > OutpostNPCs = new Dictionary<Identifier, List<Character>>()
 
Sprite PreviewImage
 

Static Public Attributes

const int HighestTier = 3
 

Properties

static IEnumerable< SubmarineInfoSavedSubmarines [get]
 
SubmarineTag Tags [get]
 
int Tier [get, set]
 
int EqualityCheckVal [get]
 A random int that gets assigned when saving the sub. Used in mp campaign to verify that sub files match More...
 
string Name [get, set]
 
LocalizedString DisplayName [get, set]
 
LocalizedString Description [get, set]
 
int Price [get, set]
 
bool InitialSuppliesSpawned [get, set]
 
bool NoItems [get, set]
 
bool LowFuel [get, set]
 Note: Refreshed for loaded submarines when they are saved, when they are loaded, and on round end. If you need to refresh it, please use Submarine.CheckFuel() method! More...
 
Version GameVersion [get, set]
 
SubmarineType Type [get, set]
 
bool IsManuallyOutfitted [get, set]
 
OutpostModuleInfo OutpostModuleInfo [get, set]
 
BeaconStationInfo BeaconStationInfo [get, set]
 
WreckInfo WreckInfo [get, set]
 
ExtraSubmarineInfo GetExtraSubmarineInfo [get]
 
bool IsOutpost [get]
 
bool IsWreck [get]
 
bool IsBeacon [get]
 
bool IsPlayer [get]
 
bool IsRuin [get]
 
bool IsCampaignCompatible [get]
 
bool IsCampaignCompatibleIgnoreClass [get]
 
bool AllowPreviewImage [get]
 
Md5Hash MD5Hash [get]
 
bool CalculatingHash [get]
 
Vector2 Dimensions [get]
 
int CargoCapacity [get]
 
string FilePath [get, set]
 
XElement SubmarineElement [get]
 
bool IsFileCorrupted [get]
 
bool RequiredContentPackagesInstalled [get, set]
 
bool SubsLeftBehind [get]
 
bool LeftBehindSubDockingPortOccupied [get]
 

Detailed Description

Member Enumeration Documentation

◆ CrewExperienceLevel

Enumerator
Unknown 
CrewExperienceLow 
CrewExperienceMid 
CrewExperienceHigh 

Definition at line 44 of file BarotraumaShared/SharedSource/Map/SubmarineInfo.cs.

Constructor & Destructor Documentation

◆ SubmarineInfo() [1/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( )

◆ SubmarineInfo() [2/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( string  filePath,
string  hash = "",
XElement  element = null,
bool  tryLoad = true 
)

◆ SubmarineInfo() [3/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( Submarine  sub)

◆ SubmarineInfo() [4/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( SubmarineInfo  original)

Member Function Documentation

◆ AddOutpostNPCIdentifierOrTag()

void Barotrauma.SubmarineInfo.AddOutpostNPCIdentifierOrTag ( Character  npc,
Identifier  idOrTag 
)

◆ AddTag()

void Barotrauma.SubmarineInfo.AddTag ( SubmarineTag  tag)

◆ AddToSavedSubs()

static void Barotrauma.SubmarineInfo.AddToSavedSubs ( SubmarineInfo  subInfo)
static

◆ CheckSubsLeftBehind()

void Barotrauma.SubmarineInfo.CheckSubsLeftBehind ( XElement  element = null)

◆ CreatePreviewWindow()

void Barotrauma.SubmarineInfo.CreatePreviewWindow ( GUIComponent  parent)

◆ CreateSpecsWindow()

void Barotrauma.SubmarineInfo.CreateSpecsWindow ( GUIListBox  parent,
GUIFont  font,
bool  includeTitle = true,
bool  includeClass = true,
bool  includeDescription = false,
bool  includeCrushDepth = false 
)

◆ Dispose()

void Barotrauma.SubmarineInfo.Dispose ( )

◆ GetDefaultTier()

static int Barotrauma.SubmarineInfo.GetDefaultTier ( int  price)
static

◆ GetPrice()

int Barotrauma.SubmarineInfo.GetPrice ( Location  location = null,
ImmutableHashSet< Character characterList = null 
)

◆ GetSubCrushDepth()

static float Barotrauma.SubmarineInfo.GetSubCrushDepth ( SubmarineInfo  subInfo,
ref PendingSubInfo  pendingSubInfo 
)
static

◆ HasTag()

bool Barotrauma.SubmarineInfo.HasTag ( SubmarineTag  tag)

◆ IsCrushDepthDefinedInStructures()

bool Barotrauma.SubmarineInfo.IsCrushDepthDefinedInStructures ( out float  realWorldCrushDepth)

Calculated from SubmarineElement. Can be used when the sub hasn't been loaded and we can't access Submarine.RealWorldCrushDepth.

Definition at line 545 of file BarotraumaShared/SharedSource/Map/SubmarineInfo.cs.

◆ IsVanillaSubmarine()

bool Barotrauma.SubmarineInfo.IsVanillaSubmarine ( )

◆ OpenFile() [1/2]

static XDocument Barotrauma.SubmarineInfo.OpenFile ( string  file)
static

◆ OpenFile() [2/2]

static XDocument Barotrauma.SubmarineInfo.OpenFile ( string  file,
out Exception  exception 
)
static

◆ PendingSubInfo()

readonly record struct Barotrauma.SubmarineInfo.PendingSubInfo ( SubmarineInfo  PendingSub = null,
bool  StructuresDefineRealWorldCrushDepth = false,
float  RealWorldCrushDepth = Level.DefaultRealWorldCrushDepth 
)

◆ RefreshSavedSub()

static void Barotrauma.SubmarineInfo.RefreshSavedSub ( string  filePath)
static

◆ RefreshSavedSubs()

static void Barotrauma.SubmarineInfo.RefreshSavedSubs ( )
static

◆ Reload()

void Barotrauma.SubmarineInfo.Reload ( )

◆ RemoveSavedSub()

static void Barotrauma.SubmarineInfo.RemoveSavedSub ( string  filePath)
static

◆ RemoveTag()

void Barotrauma.SubmarineInfo.RemoveTag ( SubmarineTag  tag)

◆ SaveAs()

void Barotrauma.SubmarineInfo.SaveAs ( string  filePath,
System.IO.MemoryStream  previewImage = null 
)

◆ StartHashDocTask()

void Barotrauma.SubmarineInfo.StartHashDocTask ( XDocument  doc)

◆ ToString()

override string Barotrauma.SubmarineInfo.ToString ( )

Member Data Documentation

◆ BlockedDockingPortIDs

readonly List<ushort> Barotrauma.SubmarineInfo.BlockedDockingPortIDs = new List<ushort>()

◆ HighestTier

const int Barotrauma.SubmarineInfo.HighestTier = 3
static

◆ LastModifiedTime

readonly DateTime Barotrauma.SubmarineInfo.LastModifiedTime

◆ LeftBehindDockingPortIDs

readonly List<ushort> Barotrauma.SubmarineInfo.LeftBehindDockingPortIDs = new List<ushort>()

◆ OutpostGenerationParams

OutpostGenerationParams Barotrauma.SubmarineInfo.OutpostGenerationParams

◆ OutpostNPCs

readonly Dictionary<Identifier, List<Character> > Barotrauma.SubmarineInfo.OutpostNPCs = new Dictionary<Identifier, List<Character>>()

◆ PreviewImage

Sprite Barotrauma.SubmarineInfo.PreviewImage

◆ RecommendedCrewExperience

CrewExperienceLevel Barotrauma.SubmarineInfo.RecommendedCrewExperience

◆ RecommendedCrewSizeMin

int Barotrauma.SubmarineInfo.RecommendedCrewSizeMin = 1

◆ RequiredContentPackages

HashSet<string> Barotrauma.SubmarineInfo.RequiredContentPackages = new HashSet<string>()

◆ SubmarineClass

SubmarineClass Barotrauma.SubmarineInfo.SubmarineClass

Property Documentation

◆ AllowPreviewImage

bool Barotrauma.SubmarineInfo.AllowPreviewImage
get

◆ BeaconStationInfo

BeaconStationInfo Barotrauma.SubmarineInfo.BeaconStationInfo
getset

◆ CalculatingHash

bool Barotrauma.SubmarineInfo.CalculatingHash
get

◆ CargoCapacity

int Barotrauma.SubmarineInfo.CargoCapacity
get

◆ Description

LocalizedString Barotrauma.SubmarineInfo.Description
getset

◆ Dimensions

Vector2 Barotrauma.SubmarineInfo.Dimensions
get

◆ DisplayName

LocalizedString Barotrauma.SubmarineInfo.DisplayName
getset

◆ EqualityCheckVal

int Barotrauma.SubmarineInfo.EqualityCheckVal
get

A random int that gets assigned when saving the sub. Used in mp campaign to verify that sub files match

Definition at line 62 of file BarotraumaShared/SharedSource/Map/SubmarineInfo.cs.

◆ FilePath

string Barotrauma.SubmarineInfo.FilePath
getset

◆ GameVersion

Version Barotrauma.SubmarineInfo.GameVersion
getset

◆ GetExtraSubmarineInfo

ExtraSubmarineInfo Barotrauma.SubmarineInfo.GetExtraSubmarineInfo
get

◆ InitialSuppliesSpawned

bool Barotrauma.SubmarineInfo.InitialSuppliesSpawned
getset

◆ IsBeacon

bool Barotrauma.SubmarineInfo.IsBeacon
get

◆ IsCampaignCompatible

bool Barotrauma.SubmarineInfo.IsCampaignCompatible
get

◆ IsCampaignCompatibleIgnoreClass

bool Barotrauma.SubmarineInfo.IsCampaignCompatibleIgnoreClass
get

◆ IsFileCorrupted

bool Barotrauma.SubmarineInfo.IsFileCorrupted
get

◆ IsManuallyOutfitted

bool Barotrauma.SubmarineInfo.IsManuallyOutfitted
getset

◆ IsOutpost

bool Barotrauma.SubmarineInfo.IsOutpost
get

◆ IsPlayer

bool Barotrauma.SubmarineInfo.IsPlayer
get

◆ IsRuin

bool Barotrauma.SubmarineInfo.IsRuin
get

◆ IsWreck

bool Barotrauma.SubmarineInfo.IsWreck
get

◆ LeftBehindSubDockingPortOccupied

bool Barotrauma.SubmarineInfo.LeftBehindSubDockingPortOccupied
get

◆ LowFuel

bool Barotrauma.SubmarineInfo.LowFuel
getset

Note: Refreshed for loaded submarines when they are saved, when they are loaded, and on round end. If you need to refresh it, please use Submarine.CheckFuel() method!

Definition at line 105 of file BarotraumaShared/SharedSource/Map/SubmarineInfo.cs.

◆ MD5Hash

Md5Hash Barotrauma.SubmarineInfo.MD5Hash
get

◆ Name

string Barotrauma.SubmarineInfo.Name
getset

◆ NoItems

bool Barotrauma.SubmarineInfo.NoItems
getset

◆ OutpostModuleInfo

OutpostModuleInfo Barotrauma.SubmarineInfo.OutpostModuleInfo
getset

◆ Price

int Barotrauma.SubmarineInfo.Price
getset

◆ RequiredContentPackagesInstalled

bool Barotrauma.SubmarineInfo.RequiredContentPackagesInstalled
getset

◆ SavedSubmarines

IEnumerable<SubmarineInfo> Barotrauma.SubmarineInfo.SavedSubmarines
staticget

◆ SubmarineElement

XElement Barotrauma.SubmarineInfo.SubmarineElement
get

◆ SubsLeftBehind

bool Barotrauma.SubmarineInfo.SubsLeftBehind
get

◆ Tags

SubmarineTag Barotrauma.SubmarineInfo.Tags
get

◆ Tier

int Barotrauma.SubmarineInfo.Tier
getset

◆ Type

SubmarineType Barotrauma.SubmarineInfo.Type
getset

◆ WreckInfo

WreckInfo Barotrauma.SubmarineInfo.WreckInfo
getset