Barotrauma Server Doc
Barotrauma.WayPoint Class Reference
Inheritance diagram for Barotrauma.WayPoint:
Barotrauma.MapEntity Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.ISpatialEntity

Public Types

enum class  Type { WayPoint , SpawnPoint }
 

Public Member Functions

void OnGapStateChanged (bool open, Gap gap)
 Only called by a Gap when the state changes. So in practice used like an event callback, although technically just a method (It would be cleaner to use an actual event in Gap.cs, but event registering and unregistering might cause an extra hassle) More...
 
 WayPoint (Vector2 position, SpawnType spawnType, Submarine submarine, Gap gap=null)
 
 WayPoint (MapEntityPrefab prefab, Rectangle rectangle)
 
 WayPoint (Rectangle newRect, Submarine submarine)
 
 WayPoint (Type type, Rectangle newRect, Submarine submarine, ushort id=Entity.NullEntityID)
 
override MapEntity Clone ()
 
void ConnectTo (WayPoint wayPoint2)
 
void FindHull ()
 
override void OnMapLoaded ()
 
void InitializeLinks ()
 
override XElement Save (XElement parentElement)
 
override void ShallowRemove ()
 Remove the entity from the entity list without removing links to other entities More...
 
override void Remove ()
 
- Public Member Functions inherited from Barotrauma.MapEntity
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 More...
 
virtual void Update (float deltaTime, Camera cam)
 
virtual void FlipX (bool relativeToSub)
 Flip the entity horizontally More...
 
virtual void FlipY (bool relativeToSub)
 Flip the entity vertically More...
 
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. More...
 
- 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. More...
 

Static Public Member Functions

static bool GenerateSubWaypoints (Submarine submarine)
 
static WayPoint GetRandom (SpawnType spawnType=SpawnType.Human, JobPrefab assignedJob=null, Submarine sub=null, bool useSyncedRand=false, string spawnPointTag=null, bool ignoreSubmarine=false)
 
static WayPoint[] SelectCrewSpawnPoints (List< CharacterInfo > crew, Submarine submarine)
 
static WayPoint Load (ContentXElement element, Submarine submarine, IdRemap idRemap)
 
- Static Public Member Functions inherited from Barotrauma.MapEntity
static void ClearHighlightedEntities ()
 
static List< MapEntityClone (List< MapEntity > entitiesToClone)
 
static void UpdateAll (float deltaTime, Camera cam)
 Call Update() on every object in Entity.list More...
 
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 More...
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID More...
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 

Public Attributes

Ladder Ladders
 
Structure Stairs
 
bool IsObstructed
 
Level.Tunnel Tunnel
 
RuinGeneration.Ruin Ruin
 
- Public Attributes inherited from Barotrauma.MapEntity
readonly MapEntityPrefab Prefab
 
List< ushort > unresolvedLinkedToID
 
readonly HashSet< IdentifierDisallowedUpgradeSet = 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) More...
 
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. More...
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 

Static Public Attributes

static List< WayPointWayPointList = new List<WayPoint>()
 
static bool ShowWayPoints = true
 
const float LadderWaypointInterval = 75.0f
 
- Static Public Attributes inherited from Barotrauma.MapEntity
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 Attributes

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

Properties

bool IsInWater [get]
 
bool IsTraversable [get]
 
Gap ConnectedGap [get, set]
 
DoorConnectedDoor [get]
 
Hull CurrentHull [get]
 
SpawnType SpawnType [get, set]
 
Point ExitPointSize [get]
 
Rectangle ExitPointWorldRect [get]
 
Action< WayPointOnLinksChanged [get, set]
 
override string? Name [get]
 
string IdCardDesc [get]
 
string[] IdCardTags [get]
 
IEnumerable< IdentifierTags [get]
 
JobPrefab AssignedJob [get]
 
- Properties inherited from Barotrauma.MapEntity
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< IdentifierAllowedLinks [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]
 
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]
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.MapEntity
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)
 
- Static Protected Attributes inherited from Barotrauma.MapEntity
static readonly HashSet< MapEntityhighlightedEntities = new HashSet<MapEntity>()
 

Detailed Description

Definition at line 16 of file WayPoint.cs.

Member Enumeration Documentation

◆ Type

Enumerator
WayPoint 
SpawnPoint 

Definition at line 143 of file WayPoint.cs.

Constructor & Destructor Documentation

◆ WayPoint() [1/4]

Barotrauma.WayPoint.WayPoint ( Vector2  position,
SpawnType  spawnType,
Submarine  submarine,
Gap  gap = null 
)

Definition at line 116 of file WayPoint.cs.

◆ WayPoint() [2/4]

Barotrauma.WayPoint.WayPoint ( MapEntityPrefab  prefab,
Rectangle  rectangle 
)

Definition at line 123 of file WayPoint.cs.

◆ WayPoint() [3/4]

Barotrauma.WayPoint.WayPoint ( Rectangle  newRect,
Submarine  submarine 
)

Definition at line 149 of file WayPoint.cs.

◆ WayPoint() [4/4]

Barotrauma.WayPoint.WayPoint ( Type  type,
Rectangle  newRect,
Submarine  submarine,
ushort  id = Entity.NullEntityID 
)

Definition at line 154 of file WayPoint.cs.

Member Function Documentation

◆ Clone()

override MapEntity Barotrauma.WayPoint.Clone ( )
virtual

Implements Barotrauma.MapEntity.

Definition at line 189 of file WayPoint.cs.

◆ ConnectTo()

void Barotrauma.WayPoint.ConnectTo ( WayPoint  wayPoint2)

Definition at line 916 of file WayPoint.cs.

◆ FindHull()

void Barotrauma.WayPoint.FindHull ( )

Definition at line 1003 of file WayPoint.cs.

◆ GenerateSubWaypoints()

static bool Barotrauma.WayPoint.GenerateSubWaypoints ( Submarine  submarine)
static

Definition at line 203 of file WayPoint.cs.

◆ GetRandom()

static WayPoint Barotrauma.WayPoint.GetRandom ( SpawnType  spawnType = SpawnType.Human,
JobPrefab  assignedJob = null,
Submarine  sub = null,
bool  useSyncedRand = false,
string  spawnPointTag = null,
bool  ignoreSubmarine = false 
)
static

Definition at line 931 of file WayPoint.cs.

◆ InitializeLinks()

void Barotrauma.WayPoint.InitializeLinks ( )

Definition at line 1039 of file WayPoint.cs.

◆ Load()

static WayPoint Barotrauma.WayPoint.Load ( ContentXElement  element,
Submarine  submarine,
IdRemap  idRemap 
)
static

Definition at line 1053 of file WayPoint.cs.

◆ OnGapStateChanged()

void Barotrauma.WayPoint.OnGapStateChanged ( bool  open,
Gap  gap 
)

Only called by a Gap when the state changes. So in practice used like an event callback, although technically just a method (It would be cleaner to use an actual event in Gap.cs, but event registering and unregistering might cause an extra hassle)

Definition at line 46 of file WayPoint.cs.

◆ OnMapLoaded()

override void Barotrauma.WayPoint.OnMapLoaded ( )
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 1015 of file WayPoint.cs.

◆ Remove()

override void Barotrauma.WayPoint.Remove ( )
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 1161 of file WayPoint.cs.

◆ Save()

override XElement Barotrauma.WayPoint.Save ( XElement  parentElement)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 1110 of file WayPoint.cs.

◆ SelectCrewSpawnPoints()

static WayPoint [] Barotrauma.WayPoint.SelectCrewSpawnPoints ( List< CharacterInfo crew,
Submarine  submarine 
)
static

Definition at line 941 of file WayPoint.cs.

◆ ShallowRemove()

override void Barotrauma.WayPoint.ShallowRemove ( )
virtual

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 1155 of file WayPoint.cs.

Member Data Documentation

◆ IsObstructed

bool Barotrauma.WayPoint.IsObstructed

Definition at line 32 of file WayPoint.cs.

◆ Ladders

Ladder Barotrauma.WayPoint.Ladders

Definition at line 27 of file WayPoint.cs.

◆ LadderWaypointInterval

const float Barotrauma.WayPoint.LadderWaypointInterval = 75.0f
static

Definition at line 22 of file WayPoint.cs.

◆ Ruin

RuinGeneration.Ruin Barotrauma.WayPoint.Ruin

Definition at line 74 of file WayPoint.cs.

◆ ShowWayPoints

bool Barotrauma.WayPoint.ShowWayPoints = true
static

Definition at line 20 of file WayPoint.cs.

◆ spawnType

SpawnType Barotrauma.WayPoint.spawnType
protected

Definition at line 24 of file WayPoint.cs.

◆ Stairs

Structure Barotrauma.WayPoint.Stairs

Definition at line 28 of file WayPoint.cs.

◆ Tunnel

Level.Tunnel Barotrauma.WayPoint.Tunnel

Definition at line 73 of file WayPoint.cs.

◆ WayPointList

List<WayPoint> Barotrauma.WayPoint.WayPointList = new List<WayPoint>()
static

Definition at line 18 of file WayPoint.cs.

Property Documentation

◆ AssignedJob

JobPrefab Barotrauma.WayPoint.AssignedJob
get

Definition at line 114 of file WayPoint.cs.

◆ ConnectedDoor

Door? Barotrauma.WayPoint.ConnectedDoor
get

Definition at line 66 of file WayPoint.cs.

◆ ConnectedGap

Gap Barotrauma.WayPoint.ConnectedGap
getset

Definition at line 60 of file WayPoint.cs.

◆ CurrentHull

Hull Barotrauma.WayPoint.CurrentHull
get

Definition at line 71 of file WayPoint.cs.

◆ ExitPointSize

Point Barotrauma.WayPoint.ExitPointSize
get

Definition at line 82 of file WayPoint.cs.

◆ ExitPointWorldRect

Rectangle Barotrauma.WayPoint.ExitPointWorldRect
get

Definition at line 84 of file WayPoint.cs.

◆ IdCardDesc

string Barotrauma.WayPoint.IdCardDesc
get

Definition at line 98 of file WayPoint.cs.

◆ IdCardTags

string [] Barotrauma.WayPoint.IdCardTags
get

Definition at line 99 of file WayPoint.cs.

◆ IsInWater

bool Barotrauma.WayPoint.IsInWater
get

Definition at line 34 of file WayPoint.cs.

◆ IsTraversable

bool Barotrauma.WayPoint.IsTraversable
get

Definition at line 38 of file WayPoint.cs.

◆ Name

override string? Barotrauma.WayPoint.Name
get

Definition at line 90 of file WayPoint.cs.

◆ OnLinksChanged

Action<WayPoint> Barotrauma.WayPoint.OnLinksChanged
getset

Definition at line 88 of file WayPoint.cs.

◆ SpawnType

SpawnType Barotrauma.WayPoint.SpawnType
getset

Definition at line 76 of file WayPoint.cs.

◆ Tags

IEnumerable<Identifier> Barotrauma.WayPoint.Tags
get

Definition at line 112 of file WayPoint.cs.