Barotrauma Server
|
Classes | |
struct | BallastFloraEventData |
interface | IEventData |
struct | NetworkFireSource |
Public Types | |
enum | EventType { Status = 0 , Decal = 1 , BackgroundSections = 2 , BallastFlora = 3 , MinValue = 0 , MaxValue = 3 } |
Public Member Functions | |
Hull (Rectangle rectangle) | |
Hull (Rectangle rectangle, Submarine submarine, ushort id=Entity.NullEntityID) | |
override MapEntity | Clone () |
void | SetModuleTags (IEnumerable< Identifier > tags) |
override void | OnMapLoaded () |
void | AddToGrid (Submarine submarine) |
int | GetWaveIndex (Vector2 position) |
int | GetWaveIndex (float xPos) |
override void | Move (Vector2 amount, bool ignoreContacts=true) |
override void | ShallowRemove () |
Remove the entity from the entity list without removing links to other entities. | |
override void | Remove () |
void | AddFireSource (FireSource fireSource) |
Decal | AddDecal (UInt32 decalId, Vector2 worldPosition, float scale, bool isNetworkEvent, int? spriteIndex=null) |
Decal | AddDecal (string decalName, Vector2 worldPosition, float scale, bool isNetworkEvent, int? spriteIndex=null) |
override void | Update (float deltaTime, Camera cam) |
void | ApplyFlowForces (float deltaTime, Item item) |
void | Extinguish (float deltaTime, float amount, Vector2 position, bool extinguishRealFires=true, bool extinguishFakeFires=true) |
void | RemoveFire (FireSource fire) |
IEnumerable< Hull > | GetConnectedHulls (bool includingThis, int? searchDepth=null, bool ignoreClosedGaps=false) |
float | GetApproximateDistance (Vector2 startPos, Vector2 endPos, Hull targetHull, float maxDistance, float distanceMultiplierPerClosedDoor=0) |
Approximate distance from this hull to the target hull, moving through open gaps without passing through walls. Uses a greedy algo and may not use the most optimal path. Returns float.MaxValue if no path is found. | |
string | CreateRoomName () |
bool | LeadsOutside (Character character) |
Does this hull have any doors leading outside? | |
BackgroundSection | GetBackgroundSection (Vector2 worldPosition) |
IEnumerable< BackgroundSection > | GetBackgroundSectionsViaContaining (Rectangle rectArea) |
bool | DoesSectionMatch (int index, int row) |
void | IncreaseSectionColorOrStrength (BackgroundSection section, Color? color, float? strength, bool requiresUpdate, bool isCleaning) |
void | SetSectionColorOrStrength (BackgroundSection section, Color? color, float? strength) |
void | CleanSection (BackgroundSection section, float cleanVal, bool updateRequired) |
override XElement | Save (XElement parentElement) |
override string | ToString () |
override bool | IsMouseOn (Vector2 position) |
void | ServerEventWrite (IWriteMessage msg, Client c, NetEntityEvent.IData extraData=null) |
void | ServerEventRead (IReadMessage msg, Client c) |
![]() | |
void | AddLinked (MapEntity entity) |
MapEntity (MapEntityPrefab prefab, Submarine submarine, ushort id) | |
void | ResolveLinks (IdRemap childRemap) |
bool | HasUpgrade (Identifier identifier) |
Upgrade | GetUpgrade (Identifier identifier) |
List< Upgrade > | GetUpgrades () |
void | SetUpgrade (Upgrade upgrade, bool createNetworkEvent=false) |
virtual bool | AddUpgrade (Upgrade upgrade, bool createNetworkEvent=false) |
Adds a new upgrade to the item. | |
MapEntity | Clone () |
override void | Remove () |
virtual void | FlipX (bool relativeToSub) |
Flip the entity horizontally. | |
virtual void | FlipY (bool relativeToSub) |
Flip the entity vertically. | |
virtual Quad2D | GetTransformedQuad () |
void | RemoveLinked (MapEntity e) |
HashSet< T > | GetLinkedEntities< T > (HashSet< T > list=null, int? maxDepth=null, Func< T, bool > filter=null) |
Gets all linked entities of specific type. | |
![]() | |
Entity (Submarine submarine, ushort id) | |
void | FreeID () |
Removes the entity from the entity dictionary and frees up the ID it was using. | |
Static Public Member Functions | |
static Rectangle | GetBorders () |
static EntityGrid | GenerateEntityGrid (Rectangle worldRect) |
static EntityGrid | GenerateEntityGrid (Submarine submarine) |
static Hull | FindHull (Vector2 position, Hull guess=null, bool useWorldCoordinates=true, bool inclusive=true) |
Returns the hull which contains the point (or null if it isn't inside any) | |
static Hull | FindHullUnoptimized (Vector2 position, Hull guess=null, bool useWorldCoordinates=true, bool inclusive=true) |
Returns the hull which contains the point (or null if it isn't inside any). The difference to FindHull is that this method goes through all hulls without trying to first find the sub the point is inside and checking the hulls in that sub. = This is slower, use with caution in situations where the sub's extents or hulls may have changed after it was loaded. | |
static void | DetectItemVisibility (Character c=null) |
static Hull | GetCleanTarget (Vector2 worldPosition) |
static Hull | Load (ContentXElement element, Submarine submarine, IdRemap idRemap) |
![]() | |
static void | ClearHighlightedEntities () |
static List< MapEntity > | Clone (List< MapEntity > entitiesToClone) |
static void | UpdateAll (float deltaTime, Camera cam) |
Call Update() on every object in Entity.list. | |
static List< MapEntity > | LoadAll (Submarine submarine, XElement parentElement, string filePath, int idOffset) |
static void | MapLoaded (List< MapEntity > entities, bool updateHulls) |
static void | InitializeLoadedLinks (IEnumerable< MapEntity > entities) |
![]() | |
static IReadOnlyCollection< Entity > | GetEntities () |
static int | FindFreeIdBlock (int minBlockSize) |
Finds a contiguous block of free IDs of at least the given size. | |
static Entity | FindEntityByID (ushort ID) |
Find an entity based on the ID. | |
static void | RemoveAll () |
static void | DumpIds (int count, string filename) |
Public Attributes | |
readonly Dictionary< Identifier, SerializableProperty > | properties |
bool | Visible = true |
readonly List< Gap > | ConnectedGaps = new List<Gap>() |
Color? | OriginalAmbientLight = null |
int | xBackgroundMax |
int | yBackgroundMax |
![]() | |
readonly MapEntityPrefab | Prefab |
List< ushort > | unresolvedLinkedToID |
readonly HashSet< Identifier > | DisallowedUpgradeSet = new HashSet<Identifier>() |
readonly List< MapEntity > | linkedTo = new List<MapEntity>() |
bool | ShouldBeSaved = true |
int | OriginalModuleIndex = -1 |
The index of the outpost module this entity originally spawned in (-1 if not an outpost item) | |
int | OriginalContainerIndex = -1 |
![]() | |
readonly ushort | ID |
Unique, but non-persistent identifier. Stays the same if the entities are created in the exactly same order, but doesn't persist e.g. between the rounds. | |
readonly string | CreationStackTrace |
readonly UInt64 | CreationIndex |
Static Public Attributes | |
static readonly List< Hull > | HullList = new List<Hull>() |
static readonly List< EntityGrid > | EntityGrids = new List<EntityGrid>() |
static bool | ShowHulls = true |
static bool | EditWater |
static bool | EditFire |
const float | OxygenDistributionSpeed = 30000.0f |
const float | OxygenDeteriorationSpeed = 0.3f |
const float | OxygenConsumptionSpeed = 700.0f |
const int | WaveWidth = 32 |
static float | WaveStiffness = 0.01f |
static float | WaveSpread = 0.02f |
static float | WaveDampening = 0.02f |
const float | MaxCompress = 1.05f |
const int | BackgroundSectionSize = 16 |
const int | BackgroundSectionsPerNetworkEvent = 16 |
const float | PressureBuildUpSpeed = 15.0f |
How fast the pressure in the hull builds up when there's a gap leading outside. | |
const float | PressureDropSpeed = 10.0f |
How fast the pressure in the hull goes back to normal when it's no longer full of water. | |
const int | MaxDecalsPerHull = 10 |
![]() | |
static readonly List< MapEntity > | MapEntityList = new List<MapEntity>() |
static int | MapEntityUpdateInterval = 1 |
static int | PoweredUpdateInterval = 1 |
![]() | |
const ushort | NullEntityID = 0 |
const ushort | EntitySpawnerID = ushort.MaxValue |
const ushort | RespawnManagerID = ushort.MaxValue - 1 |
const ushort | DummyID = ushort.MaxValue - 2 |
const ushort | ReservedIDStart = ushort.MaxValue - 3 |
const ushort | MaxEntityCount = ushort.MaxValue - 4 |
static EntitySpawner | Spawner |
Properties | |
Dictionary< Identifier, SerializableProperty > | SerializableProperties [get] |
override string | Name [get] |
LocalizedString | DisplayName [get] |
IEnumerable< Identifier > | OutpostModuleTags [get] |
Inherited flags from outpost generation. | |
string | RoomName [get, set] |
Color | AmbientLight [get, set] |
override Rectangle | Rect [get, set] |
override bool | Linkable [get] |
float | LethalPressure [get, set] |
Vector2 | Size [get] |
float | CeilingHeight [get] |
float | Surface [get] |
float | WorldSurface [get] |
float | WaterVolume [get, set] |
float | Oxygen [get, set] |
bool | IsAirlock [get] |
bool | IsWetRoom [get, set] |
bool | AvoidStaying [get, set] |
float | WaterPercentage [get] |
float | OxygenPercentage [get, set] |
float | Volume [get] |
float | Pressure [get, set] |
float[] | WaveY [get] |
float[] | WaveVel [get] |
List< BackgroundSection > | BackgroundSections [get] |
bool | SupportsPaintedColors [get] |
Color | AveragePaintedColor [get] |
Average color of the background sections. | |
bool | IsRed [get] |
Returns true if the red component of the background color is twice as bright as the blue and green. Can be used by StatusEffects. | |
bool | IsGreen [get] |
Returns true if the green component of the background color is twice as bright as the red and blue. Can be used by StatusEffects. | |
bool | IsBlue [get] |
Returns true if the blue component of the background color is twice as bright as the red and green. Can be used by StatusEffects. | |
List< FireSource > | FireSources [get] |
List< DummyFireSource > | FakeFireSources [get] |
int | FireCount [get] |
Can be used by conditionals. | |
BallastFloraBehavior | BallastFlora [get, set] |
![]() | |
string | DisallowedUpgrades [get, set] |
bool | FlippedX [get] |
bool | FlippedY [get] |
static IEnumerable< MapEntity > | HighlightedEntities [get] |
bool | ExternalHighlight [get, set] |
bool | IsHighlighted [get, set] |
virtual Rectangle | Rect [get, set] |
Rectangle | WorldRect [get] |
virtual Sprite | Sprite [get] |
virtual bool | DrawBelowWater [get] |
virtual bool | DrawOverWater [get] |
virtual bool | Linkable [get] |
IEnumerable< Identifier > | AllowedLinks [get] |
bool | ResizeHorizontal [get] |
bool | ResizeVertical [get] |
int | RectWidth [get, set] |
int | RectHeight [get, set] |
bool | SpriteDepthOverrideIsSet [get] |
float | SpriteOverrideDepth [get] |
float | SpriteDepth [get, set] |
virtual float | Scale = 1 [get, set] |
bool | HiddenInGame [get, set] |
bool | IsLayerHidden [get, set] |
Is the layer this entity is in currently hidden? If it is, the entity is not updated and should do nothing. | |
bool | IsHidden [get] |
Is the entity hidden due to HiddenInGame being enabled or the layer the entity is in being hidden? | |
override Vector2 | Position [get] |
override Vector2 | SimPosition [get] |
float | SoundRange [get, set] |
float | SightRange [get, set] |
bool | RemoveIfLinkedOutpostDoorInUse = true [get, protected set] |
string | Layer [get, set] |
virtual string | Name [get] |
![]() | |
static int | EntityCount [get] |
bool | Removed [get] |
bool | IdFreed [get] |
virtual Vector2 | SimPosition [get] |
virtual Vector2 | Position [get] |
virtual Vector2 | WorldPosition [get] |
virtual Vector2 | DrawPosition [get] |
Submarine | Submarine [get, set] |
AITarget | AiTarget [get] |
bool | InDetectable [get, set] |
Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner. | |
double | SpawnTime [get] |
string | ErrorLine [get] |
![]() | |
![]() |
Additional Inherited Members | |
![]() | |
void | ParseLinks (XElement element, IdRemap idRemap) |
virtual void | CheckIsHighlighted () |
void | InsertToList () |
![]() | |
virtual ushort | DetermineID (ushort id, Submarine submarine) |
![]() | |
List< ushort > | linkedToID |
readonly List< Upgrade > | Upgrades = new List<Upgrade>() |
List of upgrades this item has. | |
bool | flippedX |
bool | flippedY |
Rectangle | rect |
![]() | |
AITarget | aiTarget |
![]() | |
static readonly HashSet< MapEntity > | highlightedEntities = new HashSet<MapEntity>() |
Barotrauma.Hull.Hull | ( | Rectangle | rectangle | ) |
Barotrauma.Hull.Hull | ( | Rectangle | rectangle, |
Submarine | submarine, | ||
ushort | id = Entity::NullEntityID ) |
Decal Barotrauma.Hull.AddDecal | ( | string | decalName, |
Vector2 | worldPosition, | ||
float | scale, | ||
bool | isNetworkEvent, | ||
int? | spriteIndex = null ) |
Decal Barotrauma.Hull.AddDecal | ( | UInt32 | decalId, |
Vector2 | worldPosition, | ||
float | scale, | ||
bool | isNetworkEvent, | ||
int? | spriteIndex = null ) |
void Barotrauma.Hull.AddFireSource | ( | FireSource | fireSource | ) |
void Barotrauma.Hull.AddToGrid | ( | Submarine | submarine | ) |
void Barotrauma.Hull.ApplyFlowForces | ( | float | deltaTime, |
Item | item ) |
void Barotrauma.Hull.CleanSection | ( | BackgroundSection | section, |
float | cleanVal, | ||
bool | updateRequired ) |
override MapEntity Barotrauma.Hull.Clone | ( | ) |
string Barotrauma.Hull.CreateRoomName | ( | ) |
|
static |
bool Barotrauma.Hull.DoesSectionMatch | ( | int | index, |
int | row ) |
void Barotrauma.Hull.Extinguish | ( | float | deltaTime, |
float | amount, | ||
Vector2 | position, | ||
bool | extinguishRealFires = true, | ||
bool | extinguishFakeFires = true ) |
|
static |
Returns the hull which contains the point (or null if it isn't inside any)
position | The position to check |
guess | This hull is checked first: if the current hull is known, this can be used as an optimization |
useWorldCoordinates | Should world coordinates or the sub's local coordinates be used? |
inclusive | Does being exactly at the edge of the hull count as being inside? |
|
static |
Returns the hull which contains the point (or null if it isn't inside any). The difference to FindHull is that this method goes through all hulls without trying to first find the sub the point is inside and checking the hulls in that sub. = This is slower, use with caution in situations where the sub's extents or hulls may have changed after it was loaded.
|
static |
|
static |
float Barotrauma.Hull.GetApproximateDistance | ( | Vector2 | startPos, |
Vector2 | endPos, | ||
Hull | targetHull, | ||
float | maxDistance, | ||
float | distanceMultiplierPerClosedDoor = 0 ) |
Approximate distance from this hull to the target hull, moving through open gaps without passing through walls. Uses a greedy algo and may not use the most optimal path. Returns float.MaxValue if no path is found.
BackgroundSection Barotrauma.Hull.GetBackgroundSection | ( | Vector2 | worldPosition | ) |
IEnumerable< BackgroundSection > Barotrauma.Hull.GetBackgroundSectionsViaContaining | ( | Rectangle | rectArea | ) |
|
static |
IEnumerable< Hull > Barotrauma.Hull.GetConnectedHulls | ( | bool | includingThis, |
int? | searchDepth = null, | ||
bool | ignoreClosedGaps = false ) |
int Barotrauma.Hull.GetWaveIndex | ( | float | xPos | ) |
int Barotrauma.Hull.GetWaveIndex | ( | Vector2 | position | ) |
void Barotrauma.Hull.IncreaseSectionColorOrStrength | ( | BackgroundSection | section, |
Color? | color, | ||
float? | strength, | ||
bool | requiresUpdate, | ||
bool | isCleaning ) |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
bool Barotrauma.Hull.LeadsOutside | ( | Character | character | ) |
Does this hull have any doors leading outside?
character | Used to check if this character has access to the door leading outside |
|
static |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
|
virtual |
Reimplemented from Barotrauma.MapEntity.
|
virtual |
Reimplemented from Barotrauma.Entity.
void Barotrauma.Hull.RemoveFire | ( | FireSource | fire | ) |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
void Barotrauma.Hull.ServerEventRead | ( | IReadMessage | msg, |
Client | c ) |
void Barotrauma.Hull.ServerEventWrite | ( | IWriteMessage | msg, |
Client | c, | ||
NetEntityEvent.IData | extraData = null ) |
void Barotrauma.Hull.SetModuleTags | ( | IEnumerable< Identifier > | tags | ) |
void Barotrauma.Hull.SetSectionColorOrStrength | ( | BackgroundSection | section, |
Color? | color, | ||
float? | strength ) |
|
virtual |
Remove the entity from the entity list without removing links to other entities.
Reimplemented from Barotrauma.MapEntity.
override string Barotrauma.Hull.ToString | ( | ) |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Color? Barotrauma.Hull.OriginalAmbientLight = null |
|
static |
|
static |
|
static |
|
static |
How fast the pressure in the hull builds up when there's a gap leading outside.
|
static |
How fast the pressure in the hull goes back to normal when it's no longer full of water.
readonly Dictionary<Identifier, SerializableProperty> Barotrauma.Hull.properties |
|
static |
bool Barotrauma.Hull.Visible = true |
|
static |
|
static |
|
static |
|
static |
int Barotrauma.Hull.xBackgroundMax |
int Barotrauma.Hull.yBackgroundMax |
|
getset |
|
get |
Average color of the background sections.
|
getset |
|
get |
|
getset |
|
get |
|
get |
|
get |
|
get |
Can be used by conditionals.
|
get |
|
get |
|
get |
Returns true if the blue component of the background color is twice as bright as the red and green. Can be used by StatusEffects.
|
get |
Returns true if the green component of the background color is twice as bright as the red and blue. Can be used by StatusEffects.
|
get |
Returns true if the red component of the background color is twice as bright as the blue and green. Can be used by StatusEffects.
|
getset |
|
getset |
|
get |
|
get |
Implements Barotrauma.ISerializableEntity.
|
get |
Inherited flags from outpost generation.
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
Implements Barotrauma.ISerializableEntity.
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
get |
|
get |