Barotrauma Server 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)
 

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)
 

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>>()
 

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

Definition at line 30 of file SubmarineInfo.cs.

Member Enumeration Documentation

◆ CrewExperienceLevel

Enumerator
Unknown 
CrewExperienceLow 
CrewExperienceMid 
CrewExperienceHigh 

Definition at line 44 of file SubmarineInfo.cs.

Constructor & Destructor Documentation

◆ SubmarineInfo() [1/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( )

Definition at line 238 of file SubmarineInfo.cs.

◆ SubmarineInfo() [2/4]

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

Definition at line 247 of file SubmarineInfo.cs.

◆ SubmarineInfo() [3/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( Submarine  sub)

Definition at line 287 of file SubmarineInfo.cs.

◆ SubmarineInfo() [4/4]

Barotrauma.SubmarineInfo.SubmarineInfo ( SubmarineInfo  original)

Definition at line 295 of file SubmarineInfo.cs.

Member Function Documentation

◆ AddOutpostNPCIdentifierOrTag()

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

Definition at line 573 of file SubmarineInfo.cs.

◆ AddTag()

void Barotrauma.SubmarineInfo.AddTag ( SubmarineTag  tag)

Definition at line 502 of file SubmarineInfo.cs.

◆ AddToSavedSubs()

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

Definition at line 619 of file SubmarineInfo.cs.

◆ CheckSubsLeftBehind()

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

Definition at line 516 of file SubmarineInfo.cs.

◆ Dispose()

void Barotrauma.SubmarineInfo.Dispose ( )

Definition at line 460 of file SubmarineInfo.cs.

◆ GetDefaultTier()

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

◆ GetPrice()

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

Definition at line 778 of file SubmarineInfo.cs.

◆ HasTag()

bool Barotrauma.SubmarineInfo.HasTag ( SubmarineTag  tag)

Definition at line 497 of file SubmarineInfo.cs.

◆ 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 SubmarineInfo.cs.

◆ IsVanillaSubmarine()

bool Barotrauma.SubmarineInfo.IsVanillaSubmarine ( )

Definition at line 469 of file SubmarineInfo.cs.

◆ OpenFile() [1/2]

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

Definition at line 688 of file SubmarineInfo.cs.

◆ OpenFile() [2/2]

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

Definition at line 693 of file SubmarineInfo.cs.

◆ RefreshSavedSub()

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

Definition at line 636 of file SubmarineInfo.cs.

◆ RefreshSavedSubs()

static void Barotrauma.SubmarineInfo.RefreshSavedSubs ( )
static

Definition at line 650 of file SubmarineInfo.cs.

◆ Reload()

void Barotrauma.SubmarineInfo.Reload ( )

Definition at line 339 of file SubmarineInfo.cs.

◆ RemoveSavedSub()

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

Definition at line 624 of file SubmarineInfo.cs.

◆ RemoveTag()

void Barotrauma.SubmarineInfo.RemoveTag ( SubmarineTag  tag)

Definition at line 509 of file SubmarineInfo.cs.

◆ SaveAs()

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

Definition at line 583 of file SubmarineInfo.cs.

◆ StartHashDocTask()

void Barotrauma.SubmarineInfo.StartHashDocTask ( XDocument  doc)

Definition at line 485 of file SubmarineInfo.cs.

◆ ToString()

override string Barotrauma.SubmarineInfo.ToString ( )

Definition at line 189 of file SubmarineInfo.cs.

Member Data Documentation

◆ BlockedDockingPortIDs

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

Definition at line 226 of file SubmarineInfo.cs.

◆ HighestTier

const int Barotrauma.SubmarineInfo.HighestTier = 3
static

Definition at line 810 of file SubmarineInfo.cs.

◆ LastModifiedTime

readonly DateTime Barotrauma.SubmarineInfo.LastModifiedTime

Definition at line 38 of file SubmarineInfo.cs.

◆ LeftBehindDockingPortIDs

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

Definition at line 225 of file SubmarineInfo.cs.

◆ OutpostGenerationParams

OutpostGenerationParams Barotrauma.SubmarineInfo.OutpostGenerationParams

Definition at line 233 of file SubmarineInfo.cs.

◆ OutpostNPCs

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

Definition at line 235 of file SubmarineInfo.cs.

◆ RecommendedCrewExperience

CrewExperienceLevel Barotrauma.SubmarineInfo.RecommendedCrewExperience

Definition at line 51 of file SubmarineInfo.cs.

◆ RecommendedCrewSizeMin

int Barotrauma.SubmarineInfo.RecommendedCrewSizeMin = 1

Definition at line 42 of file SubmarineInfo.cs.

◆ RequiredContentPackages

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

Definition at line 64 of file SubmarineInfo.cs.

◆ SubmarineClass

SubmarineClass Barotrauma.SubmarineInfo.SubmarineClass

Definition at line 121 of file SubmarineInfo.cs.

Property Documentation

◆ AllowPreviewImage

bool Barotrauma.SubmarineInfo.AllowPreviewImage
get

Definition at line 139 of file SubmarineInfo.cs.

◆ BeaconStationInfo

BeaconStationInfo Barotrauma.SubmarineInfo.BeaconStationInfo
getset

Definition at line 124 of file SubmarineInfo.cs.

◆ CalculatingHash

bool Barotrauma.SubmarineInfo.CalculatingHash
get

Definition at line 160 of file SubmarineInfo.cs.

◆ CargoCapacity

int Barotrauma.SubmarineInfo.CargoCapacity
get

Definition at line 171 of file SubmarineInfo.cs.

◆ Description

LocalizedString Barotrauma.SubmarineInfo.Description
getset

Definition at line 78 of file SubmarineInfo.cs.

◆ Dimensions

Vector2 Barotrauma.SubmarineInfo.Dimensions
get

Definition at line 165 of file SubmarineInfo.cs.

◆ DisplayName

LocalizedString Barotrauma.SubmarineInfo.DisplayName
getset

Definition at line 72 of file SubmarineInfo.cs.

◆ 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 SubmarineInfo.cs.

◆ FilePath

string Barotrauma.SubmarineInfo.FilePath
getset

Definition at line 177 of file SubmarineInfo.cs.

◆ GameVersion

Version Barotrauma.SubmarineInfo.GameVersion
getset

Definition at line 111 of file SubmarineInfo.cs.

◆ GetExtraSubmarineInfo

ExtraSubmarineInfo Barotrauma.SubmarineInfo.GetExtraSubmarineInfo
get

Definition at line 127 of file SubmarineInfo.cs.

◆ InitialSuppliesSpawned

bool Barotrauma.SubmarineInfo.InitialSuppliesSpawned
getset

Definition at line 90 of file SubmarineInfo.cs.

◆ IsBeacon

bool Barotrauma.SubmarineInfo.IsBeacon
get

Definition at line 132 of file SubmarineInfo.cs.

◆ IsCampaignCompatible

bool Barotrauma.SubmarineInfo.IsCampaignCompatible
get

Definition at line 136 of file SubmarineInfo.cs.

◆ IsCampaignCompatibleIgnoreClass

bool Barotrauma.SubmarineInfo.IsCampaignCompatibleIgnoreClass
get

Definition at line 137 of file SubmarineInfo.cs.

◆ IsFileCorrupted

bool Barotrauma.SubmarineInfo.IsFileCorrupted
get

Definition at line 194 of file SubmarineInfo.cs.

◆ IsManuallyOutfitted

bool Barotrauma.SubmarineInfo.IsManuallyOutfitted
getset

Definition at line 119 of file SubmarineInfo.cs.

◆ IsOutpost

bool Barotrauma.SubmarineInfo.IsOutpost
get

Definition at line 129 of file SubmarineInfo.cs.

◆ IsPlayer

bool Barotrauma.SubmarineInfo.IsPlayer
get

Definition at line 133 of file SubmarineInfo.cs.

◆ IsRuin

bool Barotrauma.SubmarineInfo.IsRuin
get

Definition at line 134 of file SubmarineInfo.cs.

◆ IsWreck

bool Barotrauma.SubmarineInfo.IsWreck
get

Definition at line 131 of file SubmarineInfo.cs.

◆ LeftBehindSubDockingPortOccupied

bool Barotrauma.SubmarineInfo.LeftBehindSubDockingPortOccupied
get

Definition at line 228 of file SubmarineInfo.cs.

◆ 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 SubmarineInfo.cs.

◆ MD5Hash

Md5Hash Barotrauma.SubmarineInfo.MD5Hash
get

Definition at line 141 of file SubmarineInfo.cs.

◆ Name

string Barotrauma.SubmarineInfo.Name
getset

Definition at line 66 of file SubmarineInfo.cs.

◆ NoItems

bool Barotrauma.SubmarineInfo.NoItems
getset

Definition at line 96 of file SubmarineInfo.cs.

◆ OutpostModuleInfo

OutpostModuleInfo Barotrauma.SubmarineInfo.OutpostModuleInfo
getset

Definition at line 123 of file SubmarineInfo.cs.

◆ Price

int Barotrauma.SubmarineInfo.Price
getset

Definition at line 84 of file SubmarineInfo.cs.

◆ RequiredContentPackagesInstalled

bool Barotrauma.SubmarineInfo.RequiredContentPackagesInstalled
getset

Definition at line 201 of file SubmarineInfo.cs.

◆ SavedSubmarines

IEnumerable<SubmarineInfo> Barotrauma.SubmarineInfo.SavedSubmarines
staticget

Definition at line 33 of file SubmarineInfo.cs.

◆ SubmarineElement

XElement Barotrauma.SubmarineInfo.SubmarineElement
get

Definition at line 183 of file SubmarineInfo.cs.

◆ SubsLeftBehind

bool Barotrauma.SubmarineInfo.SubsLeftBehind
get

Definition at line 215 of file SubmarineInfo.cs.

◆ Tags

SubmarineTag Barotrauma.SubmarineInfo.Tags
get

Definition at line 40 of file SubmarineInfo.cs.

◆ Tier

int Barotrauma.SubmarineInfo.Tier
getset

Definition at line 53 of file SubmarineInfo.cs.

◆ Type

SubmarineType Barotrauma.SubmarineInfo.Type
getset

Definition at line 117 of file SubmarineInfo.cs.

◆ WreckInfo

WreckInfo Barotrauma.SubmarineInfo.WreckInfo
getset

Definition at line 125 of file SubmarineInfo.cs.