Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.LevelData Class Reference

Public Types

enum  LevelType { LocationConnection , Outpost }
 

Public Member Functions

bool IsAllowedDifficulty (float minDifficulty, float maxDifficulty)
 Inclusive (matching the min an max values is accepted).
 
 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)
 
 LevelData (Location location, Map map, float difficulty)
 Instantiates level data using the properties of the location.
 
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
 
bool OriginallyHadHuntingGrounds
 
OutpostGenerationParams ForceOutpostGenerationParams
 
SubmarineInfo ForceBeaconStation
 
SubmarineInfo ForceWreck
 
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.
 
int? MinMainPathWidth
 Determined during level generation based on the size of the submarine. Null if the level hasn't been generated.
 
readonly List< Identifier > 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.
 
readonly List< Identifier > NonRepeatableEvents = new List<Identifier>()
 Events that have already triggered in this level and can never trigger again. EventSet.OncePerLevel.
 
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.
 
const float MaxHuntingGroundsProbability = 0.3f
 Probability of hunting grounds appearing in 100% difficulty levels.
 

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.
 
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!
 
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!
 
bool OutpostGenerationParamsExist [get]
 

Member Enumeration Documentation

◆ LevelType

Enumerator
LocationConnection 
Outpost 

Constructor & Destructor Documentation

◆ LevelData() [1/4]

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

◆ LevelData() [2/4]

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

◆ LevelData() [3/4]

Barotrauma.LevelData.LevelData ( LocationConnection locationConnection)

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

◆ LevelData() [4/4]

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

Instantiates level data using the properties of the location.

Member Function Documentation

◆ CreateRandom()

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

◆ GetSuitableOutpostGenerationParams()

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

◆ IsAllowedDifficulty()

bool Barotrauma.LevelData.IsAllowedDifficulty ( float minDifficulty,
float maxDifficulty )

Inclusive (matching the min an max values is accepted).

◆ ReassignGenerationParams()

void Barotrauma.LevelData.ReassignGenerationParams ( string seed)

◆ Save()

void Barotrauma.LevelData.Save ( XElement parentElement)

Member Data Documentation

◆ AllowInvalidOutpost

bool Barotrauma.LevelData.AllowInvalidOutpost

◆ Biome

readonly Biome Barotrauma.LevelData.Biome

◆ Difficulty

readonly float Barotrauma.LevelData.Difficulty

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

◆ FinishedEvents

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

◆ ForceBeaconStation

SubmarineInfo Barotrauma.LevelData.ForceBeaconStation

◆ ForceOutpostGenerationParams

OutpostGenerationParams Barotrauma.LevelData.ForceOutpostGenerationParams

◆ ForceWreck

SubmarineInfo Barotrauma.LevelData.ForceWreck

◆ HasBeaconStation

bool Barotrauma.LevelData.HasBeaconStation

◆ HasHuntingGrounds

bool Barotrauma.LevelData.HasHuntingGrounds

◆ HuntingGroundsDifficultyThreshold

const float Barotrauma.LevelData.HuntingGroundsDifficultyThreshold = 25
static

Minimum difficulty of the level before hunting grounds can appear.

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

◆ IsBeaconActive

bool Barotrauma.LevelData.IsBeaconActive

◆ MaxHuntingGroundsProbability

const float Barotrauma.LevelData.MaxHuntingGroundsProbability = 0.3f
static

Probability of hunting grounds appearing in 100% difficulty levels.

◆ MinMainPathWidth

int? Barotrauma.LevelData.MinMainPathWidth

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

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

◆ OriginallyHadHuntingGrounds

bool Barotrauma.LevelData.OriginallyHadHuntingGrounds

◆ Seed

readonly string Barotrauma.LevelData.Seed

◆ Size

readonly Point Barotrauma.LevelData.Size

◆ Type

readonly LevelType Barotrauma.LevelData.Type

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!

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

◆ GenerationParams

LevelGenerationParams Barotrauma.LevelData.GenerationParams
get

◆ OutpostGenerationParamsExist

bool Barotrauma.LevelData.OutpostGenerationParamsExist
get

◆ 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!


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