Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.MapEntity Class Referenceabstract
Inheritance diagram for Barotrauma.MapEntity:
Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.ISpatialEntity Barotrauma.Gap Barotrauma.Hull Barotrauma.Hull Barotrauma.Item Barotrauma.Item Barotrauma.LinkedSubmarine Barotrauma.Structure Barotrauma.Structure Barotrauma.WayPoint

Public Member Functions

void AddLinked (MapEntity entity)
 
 MapEntity (MapEntityPrefab prefab, Submarine submarine, ushort id)
 
void ResolveLinks (IdRemap childRemap)
 
virtual void Move (Vector2 amount, bool ignoreContacts=true)
 
virtual bool IsMouseOn (Vector2 position)
 
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 ()
 
virtual void ShallowRemove ()
 Remove the entity from the entity list without removing links to other entities.
 
override void Remove ()
 
virtual void Update (float deltaTime, Camera cam)
 
virtual void FlipX (bool relativeToSub)
 Flip the entity horizontally.
 
virtual void FlipY (bool relativeToSub)
 Flip the entity vertically.
 
virtual Quad2D GetTransformedQuad ()
 
virtual void OnMapLoaded ()
 
virtual XElement Save (XElement parentElement)
 
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.
 
- Public Member Functions inherited from Barotrauma.Entity
 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 void ClearHighlightedEntities ()
 
static List< MapEntityClone (List< MapEntity > entitiesToClone)
 
static void UpdateAll (float deltaTime, Camera cam)
 Call Update() on every object in Entity.list.
 
static List< MapEntityLoadAll (Submarine submarine, XElement parentElement, string filePath, int idOffset)
 
static void MapLoaded (List< MapEntity > entities, bool updateHulls)
 
static void InitializeLoadedLinks (IEnumerable< MapEntity > entities)
 
- Static Public Member Functions inherited from Barotrauma.Entity
static IReadOnlyCollection< EntityGetEntities ()
 
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 MapEntityPrefab Prefab
 
List< ushort > unresolvedLinkedToID
 
readonly HashSet< Identifier > DisallowedUpgradeSet = new HashSet<Identifier>()
 
readonly List< MapEntitylinkedTo = 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
 
- Public Attributes inherited from Barotrauma.Entity
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< MapEntityMapEntityList = new List<MapEntity>()
 
static int MapEntityUpdateInterval = 1
 
static int PoweredUpdateInterval = 1
 
- Static Public Attributes inherited from Barotrauma.Entity
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
 

Protected Member Functions

void ParseLinks (XElement element, IdRemap idRemap)
 
virtual void CheckIsHighlighted ()
 
void InsertToList ()
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 

Protected Attributes

List< ushort > linkedToID
 
readonly List< Upgrade > Upgrades = new List<Upgrade>()
 List of upgrades this item has.
 
bool flippedX
 
bool flippedY
 
Rectangle rect
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Static Protected Attributes

static readonly HashSet< MapEntityhighlightedEntities = new HashSet<MapEntity>()
 

Properties

string DisallowedUpgrades [get, set]
 
bool FlippedX [get]
 
bool FlippedY [get]
 
static IEnumerable< MapEntityHighlightedEntities [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]
 
- Properties inherited from Barotrauma.Entity
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]
 
- Properties inherited from Barotrauma.ISpatialEntity

Constructor & Destructor Documentation

◆ MapEntity()

Barotrauma.MapEntity.MapEntity ( MapEntityPrefab prefab,
Submarine submarine,
ushort id )

Member Function Documentation

◆ AddLinked()

void Barotrauma.MapEntity.AddLinked ( MapEntity entity)

◆ AddUpgrade()

virtual bool Barotrauma.MapEntity.AddUpgrade ( Upgrade upgrade,
bool createNetworkEvent = false )
virtual

Adds a new upgrade to the item.

Reimplemented in Barotrauma.Structure.

◆ CheckIsHighlighted()

virtual void Barotrauma.MapEntity.CheckIsHighlighted ( )
protectedvirtual

◆ ClearHighlightedEntities()

static void Barotrauma.MapEntity.ClearHighlightedEntities ( )
static

◆ Clone() [1/2]

MapEntity Barotrauma.MapEntity.Clone ( )
abstract

◆ Clone() [2/2]

static List< MapEntity > Barotrauma.MapEntity.Clone ( List< MapEntity > entitiesToClone)
static

◆ FlipX()

virtual void Barotrauma.MapEntity.FlipX ( bool relativeToSub)
virtual

Flip the entity horizontally.

Parameters
relativeToSubShould the entity be flipped across the y-axis of the sub it's inside

Reimplemented in Barotrauma.Item, and Barotrauma.Structure.

◆ FlipY()

virtual void Barotrauma.MapEntity.FlipY ( bool relativeToSub)
virtual

Flip the entity vertically.

Parameters
relativeToSubShould the entity be flipped across the x-axis of the sub it's inside

Reimplemented in Barotrauma.Item, and Barotrauma.Structure.

◆ GetLinkedEntities< T >()

HashSet< T > Barotrauma.MapEntity.GetLinkedEntities< T > ( HashSet< T > list = null,
int? maxDepth = null,
Func< T, bool > filter = null )

Gets all linked entities of specific type.

Type Constraints
T :MapEntity 

◆ GetTransformedQuad()

virtual Quad2D Barotrauma.MapEntity.GetTransformedQuad ( )
virtual

Reimplemented in Barotrauma.Item, and Barotrauma.Structure.

◆ GetUpgrade()

Upgrade Barotrauma.MapEntity.GetUpgrade ( Identifier identifier)

◆ GetUpgrades()

List< Upgrade > Barotrauma.MapEntity.GetUpgrades ( )

◆ HasUpgrade()

bool Barotrauma.MapEntity.HasUpgrade ( Identifier identifier)

◆ InitializeLoadedLinks()

static void Barotrauma.MapEntity.InitializeLoadedLinks ( IEnumerable< MapEntity > entities)
static

◆ InsertToList()

void Barotrauma.MapEntity.InsertToList ( )
protected

◆ IsMouseOn()

virtual bool Barotrauma.MapEntity.IsMouseOn ( Vector2 position)
virtual

◆ LoadAll()

static List< MapEntity > Barotrauma.MapEntity.LoadAll ( Submarine submarine,
XElement parentElement,
string filePath,
int idOffset )
static

◆ MapLoaded()

static void Barotrauma.MapEntity.MapLoaded ( List< MapEntity > entities,
bool updateHulls )
static

◆ Move()

virtual void Barotrauma.MapEntity.Move ( Vector2 amount,
bool ignoreContacts = true )
virtual

◆ OnMapLoaded()

virtual void Barotrauma.MapEntity.OnMapLoaded ( )
virtual

◆ ParseLinks()

void Barotrauma.MapEntity.ParseLinks ( XElement element,
IdRemap idRemap )
protected

◆ Remove()

override void Barotrauma.MapEntity.Remove ( )
virtual

Reimplemented from Barotrauma.Entity.

Reimplemented in Barotrauma.Structure, and Barotrauma.WayPoint.

◆ RemoveLinked()

void Barotrauma.MapEntity.RemoveLinked ( MapEntity e)

◆ ResolveLinks()

void Barotrauma.MapEntity.ResolveLinks ( IdRemap childRemap)

◆ Save()

virtual XElement Barotrauma.MapEntity.Save ( XElement parentElement)
virtual

◆ SetUpgrade()

void Barotrauma.MapEntity.SetUpgrade ( Upgrade upgrade,
bool createNetworkEvent = false )

◆ ShallowRemove()

virtual void Barotrauma.MapEntity.ShallowRemove ( )
virtual

Remove the entity from the entity list without removing links to other entities.

Reimplemented in Barotrauma.Gap, Barotrauma.Hull, Barotrauma.Item, Barotrauma.Structure, and Barotrauma.WayPoint.

◆ Update()

virtual void Barotrauma.MapEntity.Update ( float deltaTime,
Camera cam )
virtual

◆ UpdateAll()

static void Barotrauma.MapEntity.UpdateAll ( float deltaTime,
Camera cam )
static

Call Update() on every object in Entity.list.

Member Data Documentation

◆ DisallowedUpgradeSet

readonly HashSet<Identifier> Barotrauma.MapEntity.DisallowedUpgradeSet = new HashSet<Identifier>()

◆ flippedX

bool Barotrauma.MapEntity.flippedX
protected

◆ flippedY

bool Barotrauma.MapEntity.flippedY
protected

◆ highlightedEntities

readonly HashSet<MapEntity> Barotrauma.MapEntity.highlightedEntities = new HashSet<MapEntity>()
staticprotected

◆ linkedTo

readonly List<MapEntity> Barotrauma.MapEntity.linkedTo = new List<MapEntity>()

◆ linkedToID

List<ushort> Barotrauma.MapEntity.linkedToID
protected

◆ MapEntityList

readonly List<MapEntity> Barotrauma.MapEntity.MapEntityList = new List<MapEntity>()
static

◆ MapEntityUpdateInterval

int Barotrauma.MapEntity.MapEntityUpdateInterval = 1
static

◆ OriginalContainerIndex

int Barotrauma.MapEntity.OriginalContainerIndex = -1

◆ OriginalModuleIndex

int Barotrauma.MapEntity.OriginalModuleIndex = -1

The index of the outpost module this entity originally spawned in (-1 if not an outpost item)

◆ PoweredUpdateInterval

int Barotrauma.MapEntity.PoweredUpdateInterval = 1
static

◆ Prefab

readonly MapEntityPrefab Barotrauma.MapEntity.Prefab

◆ rect

Rectangle Barotrauma.MapEntity.rect
protected

◆ ShouldBeSaved

bool Barotrauma.MapEntity.ShouldBeSaved = true

◆ unresolvedLinkedToID

List<ushort> Barotrauma.MapEntity.unresolvedLinkedToID

◆ Upgrades

readonly List<Upgrade> Barotrauma.MapEntity.Upgrades = new List<Upgrade>()
protected

List of upgrades this item has.

Property Documentation

◆ AllowedLinks

IEnumerable<Identifier> Barotrauma.MapEntity.AllowedLinks
get

◆ DisallowedUpgrades

string Barotrauma.MapEntity.DisallowedUpgrades
getset

◆ DrawBelowWater

virtual bool Barotrauma.MapEntity.DrawBelowWater
get

◆ DrawOverWater

virtual bool Barotrauma.MapEntity.DrawOverWater
get

◆ ExternalHighlight

bool Barotrauma.MapEntity.ExternalHighlight
getset

◆ FlippedX

bool Barotrauma.MapEntity.FlippedX
get

◆ FlippedY

bool Barotrauma.MapEntity.FlippedY
get

◆ HiddenInGame

bool Barotrauma.MapEntity.HiddenInGame
getset

◆ HighlightedEntities

IEnumerable<MapEntity> Barotrauma.MapEntity.HighlightedEntities
staticget

◆ IsHidden

bool Barotrauma.MapEntity.IsHidden
get

Is the entity hidden due to HiddenInGame being enabled or the layer the entity is in being hidden?

◆ IsHighlighted

bool Barotrauma.MapEntity.IsHighlighted
getset

◆ IsLayerHidden

bool Barotrauma.MapEntity.IsLayerHidden
getset

Is the layer this entity is in currently hidden? If it is, the entity is not updated and should do nothing.

◆ Layer

string Barotrauma.MapEntity.Layer
getset

◆ Linkable

virtual bool Barotrauma.MapEntity.Linkable
get

◆ Name

virtual string Barotrauma.MapEntity.Name
get

◆ Position

override Vector2 Barotrauma.MapEntity.Position
get

◆ Rect

virtual Rectangle Barotrauma.MapEntity.Rect
getset

◆ RectHeight

int Barotrauma.MapEntity.RectHeight
getset

◆ RectWidth

int Barotrauma.MapEntity.RectWidth
getset

◆ RemoveIfLinkedOutpostDoorInUse

bool Barotrauma.MapEntity.RemoveIfLinkedOutpostDoorInUse = true
getprotected set

◆ ResizeHorizontal

bool Barotrauma.MapEntity.ResizeHorizontal
get

◆ ResizeVertical

bool Barotrauma.MapEntity.ResizeVertical
get

◆ Scale

virtual float Barotrauma.MapEntity.Scale = 1
getset

◆ SightRange

float Barotrauma.MapEntity.SightRange
getset

◆ SimPosition

override Vector2 Barotrauma.MapEntity.SimPosition
get

◆ SoundRange

float Barotrauma.MapEntity.SoundRange
getset

◆ Sprite

virtual Sprite Barotrauma.MapEntity.Sprite
get

◆ SpriteDepth

float Barotrauma.MapEntity.SpriteDepth
getset

◆ SpriteDepthOverrideIsSet

bool Barotrauma.MapEntity.SpriteDepthOverrideIsSet
get

◆ SpriteOverrideDepth

float Barotrauma.MapEntity.SpriteOverrideDepth
get

◆ WorldRect

Rectangle Barotrauma.MapEntity.WorldRect
get

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