Barotrauma Client Doc
Barotrauma.LevelData Class Reference

Public Types

enum class  LevelType { LocationConnection , Outpost }
 

Public Member Functions

 LevelData (string seed, float difficulty, float sizeFactor, LevelGenerationParams generationParams, Biome biome)
 
 LevelData (XElement element, float? forceDifficulty=null, bool clampDifficultyToBiome=false)
 
 LevelData (LocationConnection locationConnection)
 Instantiates level data using the properties of the connection (seed, size, difficulty) More...
 
 LevelData (Location location, Map map, float difficulty)
 Instantiates level data using the properties of the location More...
 
void ReassignGenerationParams (string seed)
 
void Save (XElement parentElement)
 

Static Public Member Functions

static LevelData CreateRandom (string seed="", float? difficulty=null, LevelGenerationParams generationParams=null, bool requireOutpost=false)
 
static IEnumerable< OutpostGenerationParamsGetSuitableOutpostGenerationParams (Location location, LevelData levelData)
 

Public Attributes

readonly LevelType Type
 
readonly string Seed
 
readonly float Difficulty
 
readonly Biome Biome
 
bool HasBeaconStation
 
bool IsBeaconActive
 
bool HasHuntingGrounds
 
OutpostGenerationParams ForceOutpostGenerationParams
 
bool AllowInvalidOutpost
 
readonly Point Size
 
readonly int InitialDepth
 The depth at which the level starts at, in in-game coordinates. E.g. if this was set to 100 000 (= 1000 m), the nav terminal would display the depth as 1000 meters at the top of the level. More...
 
int? MinMainPathWidth
 Determined during level generation based on the size of the submarine. Null if the level hasn't been generated. More...
 
readonly List< IdentifierEventHistory = new List<Identifier>()
 Events that have previously triggered in this level. Used for making events the player hasn't seen yet more likely to trigger when re-entering the level. Has a maximum size of EventManager.MaxEventHistory. More...
 
readonly List< IdentifierNonRepeatableEvents = new List<Identifier>()
 Events that have already triggered in this level and can never trigger again. EventSet.OncePerLevel. More...
 
readonly Dictionary< EventSet, int > FinishedEvents = new Dictionary<EventSet, int>()
 

Static Public Attributes

const float HuntingGroundsDifficultyThreshold = 25
 Minimum difficulty of the level before hunting grounds can appear. More...
 
const float MaxHuntingGroundsProbability = 0.3f
 Probability of hunting grounds appearing in 100% difficulty levels. More...
 

Properties

LevelGenerationParams GenerationParams [get]
 
bool EventsExhausted [get, set]
 'Exhaustible' sets won't appear in the same level until after one world step (~10 min, see Map.ProgressWorld) has passed. EventSet.Exhaustible. More...
 
float CrushDepth [get]
 The crush depth of a non-upgraded submarine in in-game coordinates. Note that this can be above the top of the level! More...
 
float RealWorldCrushDepth [get]
 The crush depth of a non-upgraded submarine in "real world units" (meters from the surface of Europa). Note that this can be above the top of the level! More...
 
bool OutpostGenerationParamsExist [get]
 

Detailed Description

Definition at line 11 of file LevelData.cs.

Member Enumeration Documentation

◆ LevelType

Enumerator
LocationConnection 
Outpost 

Definition at line 13 of file LevelData.cs.

Constructor & Destructor Documentation

◆ LevelData() [1/4]

Barotrauma.LevelData.LevelData ( string  seed,
float  difficulty,
float  sizeFactor,
LevelGenerationParams  generationParams,
Biome  biome 
)

Definition at line 99 of file LevelData.cs.

◆ LevelData() [2/4]

Barotrauma.LevelData.LevelData ( XElement  element,
float?  forceDifficulty = null,
bool  clampDifficultyToBiome = false 
)

Definition at line 117 of file LevelData.cs.

◆ LevelData() [3/4]

Barotrauma.LevelData.LevelData ( LocationConnection  locationConnection)

Instantiates level data using the properties of the connection (seed, size, difficulty)

Definition at line 207 of file LevelData.cs.

◆ LevelData() [4/4]

Barotrauma.LevelData.LevelData ( Location  location,
Map  map,
float  difficulty 
)

Instantiates level data using the properties of the location

Definition at line 242 of file LevelData.cs.

Member Function Documentation

◆ CreateRandom()

static LevelData Barotrauma.LevelData.CreateRandom ( string  seed = "",
float?  difficulty = null,
LevelGenerationParams  generationParams = null,
bool  requireOutpost = false 
)
static

Definition at line 258 of file LevelData.cs.

◆ GetSuitableOutpostGenerationParams()

static IEnumerable<OutpostGenerationParams> Barotrauma.LevelData.GetSuitableOutpostGenerationParams ( Location  location,
LevelData  levelData 
)
static

Definition at line 306 of file LevelData.cs.

◆ ReassignGenerationParams()

void Barotrauma.LevelData.ReassignGenerationParams ( string  seed)

Definition at line 300 of file LevelData.cs.

◆ Save()

void Barotrauma.LevelData.Save ( XElement  parentElement)

Definition at line 325 of file LevelData.cs.

Member Data Documentation

◆ AllowInvalidOutpost

bool Barotrauma.LevelData.AllowInvalidOutpost

Definition at line 46 of file LevelData.cs.

◆ Biome

readonly Biome Barotrauma.LevelData.Biome

Definition at line 25 of file LevelData.cs.

◆ Difficulty

readonly float Barotrauma.LevelData.Difficulty

Definition at line 23 of file LevelData.cs.

◆ EventHistory

readonly List<Identifier> Barotrauma.LevelData.EventHistory = new List<Identifier>()

Events that have previously triggered in this level. Used for making events the player hasn't seen yet more likely to trigger when re-entering the level. Has a maximum size of EventManager.MaxEventHistory.

Definition at line 63 of file LevelData.cs.

◆ FinishedEvents

readonly Dictionary<EventSet, int> Barotrauma.LevelData.FinishedEvents = new Dictionary<EventSet, int>()

Definition at line 70 of file LevelData.cs.

◆ ForceOutpostGenerationParams

OutpostGenerationParams Barotrauma.LevelData.ForceOutpostGenerationParams

Definition at line 44 of file LevelData.cs.

◆ HasBeaconStation

bool Barotrauma.LevelData.HasBeaconStation

Definition at line 29 of file LevelData.cs.

◆ HasHuntingGrounds

bool Barotrauma.LevelData.HasHuntingGrounds

Definition at line 32 of file LevelData.cs.

◆ HuntingGroundsDifficultyThreshold

const float Barotrauma.LevelData.HuntingGroundsDifficultyThreshold = 25
static

Minimum difficulty of the level before hunting grounds can appear.

Definition at line 37 of file LevelData.cs.

◆ InitialDepth

readonly int Barotrauma.LevelData.InitialDepth

The depth at which the level starts at, in in-game coordinates. E.g. if this was set to 100 000 (= 1000 m), the nav terminal would display the depth as 1000 meters at the top of the level.

Definition at line 53 of file LevelData.cs.

◆ IsBeaconActive

bool Barotrauma.LevelData.IsBeaconActive

Definition at line 30 of file LevelData.cs.

◆ MaxHuntingGroundsProbability

const float Barotrauma.LevelData.MaxHuntingGroundsProbability = 0.3f
static

Probability of hunting grounds appearing in 100% difficulty levels.

Definition at line 42 of file LevelData.cs.

◆ MinMainPathWidth

int? Barotrauma.LevelData.MinMainPathWidth

Determined during level generation based on the size of the submarine. Null if the level hasn't been generated.

Definition at line 58 of file LevelData.cs.

◆ NonRepeatableEvents

readonly List<Identifier> Barotrauma.LevelData.NonRepeatableEvents = new List<Identifier>()

Events that have already triggered in this level and can never trigger again. EventSet.OncePerLevel.

Definition at line 68 of file LevelData.cs.

◆ Seed

readonly string Barotrauma.LevelData.Seed

Definition at line 21 of file LevelData.cs.

◆ Size

readonly Point Barotrauma.LevelData.Size

Definition at line 48 of file LevelData.cs.

◆ Type

readonly LevelType Barotrauma.LevelData.Type

Definition at line 19 of file LevelData.cs.

Property Documentation

◆ CrushDepth

float Barotrauma.LevelData.CrushDepth
get

The crush depth of a non-upgraded submarine in in-game coordinates. Note that this can be above the top of the level!

Definition at line 80 of file LevelData.cs.

◆ EventsExhausted

bool Barotrauma.LevelData.EventsExhausted
getset

'Exhaustible' sets won't appear in the same level until after one world step (~10 min, see Map.ProgressWorld) has passed. EventSet.Exhaustible.

Definition at line 75 of file LevelData.cs.

◆ GenerationParams

LevelGenerationParams Barotrauma.LevelData.GenerationParams
get

Definition at line 27 of file LevelData.cs.

◆ OutpostGenerationParamsExist

bool Barotrauma.LevelData.OutpostGenerationParamsExist
get

Definition at line 304 of file LevelData.cs.

◆ RealWorldCrushDepth

float Barotrauma.LevelData.RealWorldCrushDepth
get

The crush depth of a non-upgraded submarine in "real world units" (meters from the surface of Europa). Note that this can be above the top of the level!

Definition at line 91 of file LevelData.cs.