Barotrauma Client Doc
Barotrauma.Map Class Reference

Classes

struct  LocationChangeInfo
 

Public Member Functions

IEnumerable< int > GetSelectedMissionIndices ()
 
 Map (CampaignSettings settings)
 
 Map (CampaignMode campaign, string seed)
 Generate a new campaign map from the seed More...
 
Biome GetBiome (Vector2 mapPos)
 
Biome GetBiome (float xPos)
 
void MoveToNextLocation ()
 
void SetLocation (int index)
 
void SelectLocation (int index)
 
void SelectLocation (Location location)
 
void SelectMission (IEnumerable< int > missionIndices)
 
void SelectRandomLocation (bool preferUndiscovered)
 
void ProgressWorld (CampaignMode campaign, CampaignMode.TransitionType transitionType, float roundDuration)
 
void Discover (Location location, bool checkTalents=true)
 
void Visit (Location location)
 
void ClearLocationHistory ()
 
int? GetDiscoveryIndex (Location location)
 
int? GetVisitIndex (Location location, bool includeLocationsWithoutOutpost=false)
 
bool IsDiscovered (Location location)
 
bool IsVisited (Location location)
 
void LoadState (CampaignMode campaign, XElement element, bool showNotifications)
 Load the state of an existing map from xml (current state of locations, where the crew is now, etc). More...
 
void Save (XElement element)
 
void Remove ()
 
void DrawNotifications (SpriteBatch spriteBatch, GUICustomComponent container)
 
void Update (CampaignMode campaign, float deltaTime, GUICustomComponent mapContainer)
 
void Draw (CampaignMode campaign, SpriteBatch spriteBatch, GUICustomComponent mapContainer)
 
void ResetPendingSub ()
 Resets pendingSubInfo and forces crush depth to be calculated again for icon displaying purposes More...
 

Static Public Member Functions

static bool LocationOrConnectionWithinDistance (Location startLocation, int maxDistance, Func< Location, bool > criteria, Func< LocationConnection, bool > connectionCriteria=null)
 
static int GetDistanceToClosestLocationOrConnection (Location startLocation, int maxDistance, Func< Location, bool > criteria, Func< LocationConnection, bool > connectionCriteria=null)
 Get the shortest distance from the start location to another location that satisfies the specified criteria. More...
 
static Map Load (CampaignMode campaign, XElement element)
 Load a previously saved map from an xml element More...
 
static void DrawNoise (SpriteBatch spriteBatch, Rectangle rect, float strength)
 

Public Attributes

bool AllowDebugTeleport
 
Action< Location, LocationConnectionOnLocationSelected
 
Action< LocationConnection, IEnumerable< Mission > > OnMissionsSelected
 
readonly NamedEvent< LocationChangeInfoOnLocationChanged = new NamedEvent<LocationChangeInfo>()
 From -> To More...
 
Radiation Radiation
 
Vector2 DrawOffset
 

Properties

int Width [get]
 
int Height [get]
 
IReadOnlyList< LocationEndLocations [get]
 
Location StartLocation [get]
 
Location CurrentLocation [get]
 
int CurrentLocationIndex [get]
 
Location SelectedLocation [get]
 
int SelectedLocationIndex [get]
 
LocationConnection SelectedConnection [get]
 
string Seed [get]
 
List< LocationLocations [get]
 
List< LocationConnectionConnections [get]
 
Location HighlightedLocation [get]
 

Detailed Description

Definition at line 11 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

Constructor & Destructor Documentation

◆ Map() [1/2]

Barotrauma.Map.Map ( CampaignSettings  settings)

Definition at line 81 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ Map() [2/2]

Barotrauma.Map.Map ( CampaignMode  campaign,
string  seed 
)

Generate a new campaign map from the seed

Definition at line 285 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

Member Function Documentation

◆ ClearLocationHistory()

void Barotrauma.Map.ClearLocationHistory ( )

◆ Discover()

void Barotrauma.Map.Discover ( Location  location,
bool  checkTalents = true 
)

◆ Draw()

void Barotrauma.Map.Draw ( CampaignMode  campaign,
SpriteBatch  spriteBatch,
GUICustomComponent  mapContainer 
)

◆ DrawNoise()

static void Barotrauma.Map.DrawNoise ( SpriteBatch  spriteBatch,
Rectangle  rect,
float  strength 
)
static

◆ DrawNotifications()

void Barotrauma.Map.DrawNotifications ( SpriteBatch  spriteBatch,
GUICustomComponent  container 
)

◆ GetBiome() [1/2]

Biome Barotrauma.Map.GetBiome ( float  xPos)

◆ GetBiome() [2/2]

Biome Barotrauma.Map.GetBiome ( Vector2  mapPos)

◆ GetDiscoveryIndex()

int? Barotrauma.Map.GetDiscoveryIndex ( Location  location)

◆ GetDistanceToClosestLocationOrConnection()

static int Barotrauma.Map.GetDistanceToClosestLocationOrConnection ( Location  startLocation,
int  maxDistance,
Func< Location, bool >  criteria,
Func< LocationConnection, bool >  connectionCriteria = null 
)
static

Get the shortest distance from the start location to another location that satisfies the specified criteria.

Returns
The distance to a matching location, or int.MaxValue if none are found.

Definition at line 1340 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ GetSelectedMissionIndices()

IEnumerable<int> Barotrauma.Map.GetSelectedMissionIndices ( )

Definition at line 61 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ GetVisitIndex()

int? Barotrauma.Map.GetVisitIndex ( Location  location,
bool  includeLocationsWithoutOutpost = false 
)

◆ IsDiscovered()

bool Barotrauma.Map.IsDiscovered ( Location  location)

◆ IsVisited()

bool Barotrauma.Map.IsVisited ( Location  location)

◆ Load()

static Map Barotrauma.Map.Load ( CampaignMode  campaign,
XElement  element 
)
static

Load a previously saved map from an xml element

Definition at line 1444 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ LoadState()

void Barotrauma.Map.LoadState ( CampaignMode  campaign,
XElement  element,
bool  showNotifications 
)

Load the state of an existing map from xml (current state of locations, where the crew is now, etc).

Definition at line 1457 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ LocationOrConnectionWithinDistance()

static bool Barotrauma.Map.LocationOrConnectionWithinDistance ( Location  startLocation,
int  maxDistance,
Func< Location, bool >  criteria,
Func< LocationConnection, bool >  connectionCriteria = null 
)
static

◆ MoveToNextLocation()

void Barotrauma.Map.MoveToNextLocation ( )

◆ ProgressWorld()

void Barotrauma.Map.ProgressWorld ( CampaignMode  campaign,
CampaignMode.TransitionType  transitionType,
float  roundDuration 
)

◆ Remove()

void Barotrauma.Map.Remove ( )

◆ ResetPendingSub()

void Barotrauma.Map.ResetPendingSub ( )

Resets pendingSubInfo and forces crush depth to be calculated again for icon displaying purposes

Definition at line 1274 of file BarotraumaClient/ClientSource/Map/Map/Map.cs.

◆ Save()

void Barotrauma.Map.Save ( XElement  element)

◆ SelectLocation() [1/2]

void Barotrauma.Map.SelectLocation ( int  index)

◆ SelectLocation() [2/2]

void Barotrauma.Map.SelectLocation ( Location  location)

◆ SelectMission()

void Barotrauma.Map.SelectMission ( IEnumerable< int >  missionIndices)

◆ SelectRandomLocation()

void Barotrauma.Map.SelectRandomLocation ( bool  preferUndiscovered)

◆ SetLocation()

void Barotrauma.Map.SetLocation ( int  index)

◆ Update()

void Barotrauma.Map.Update ( CampaignMode  campaign,
float  deltaTime,
GUICustomComponent  mapContainer 
)

◆ Visit()

void Barotrauma.Map.Visit ( Location  location)

Member Data Documentation

◆ AllowDebugTeleport

bool Barotrauma.Map.AllowDebugTeleport

Definition at line 13 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ DrawOffset

Vector2 Barotrauma.Map.DrawOffset

Definition at line 55 of file BarotraumaClient/ClientSource/Map/Map/Map.cs.

◆ OnLocationChanged

readonly NamedEvent<LocationChangeInfo> Barotrauma.Map.OnLocationChanged = new NamedEvent<LocationChangeInfo>()

From -> To

Definition at line 40 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ OnLocationSelected

Action<Location, LocationConnection> Barotrauma.Map.OnLocationSelected

Definition at line 22 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ OnMissionsSelected

Action<LocationConnection, IEnumerable<Mission> > Barotrauma.Map.OnMissionsSelected

Definition at line 23 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ Radiation

Radiation Barotrauma.Map.Radiation

Definition at line 77 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

Property Documentation

◆ Connections

List<LocationConnection> Barotrauma.Map.Connections
get

Definition at line 75 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ CurrentLocation

Location Barotrauma.Map.CurrentLocation
get

Definition at line 47 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ CurrentLocationIndex

int Barotrauma.Map.CurrentLocationIndex
get

Definition at line 49 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ EndLocations

IReadOnlyList<Location> Barotrauma.Map.EndLocations
get

Definition at line 43 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ Height

int Barotrauma.Map.Height
get

Definition at line 20 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ HighlightedLocation

Location Barotrauma.Map.HighlightedLocation
get

Definition at line 51 of file BarotraumaClient/ClientSource/Map/Map/Map.cs.

◆ Locations

List<Location> Barotrauma.Map.Locations
get

Definition at line 70 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ Seed

string Barotrauma.Map.Seed
get

Definition at line 68 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ SelectedConnection

LocationConnection Barotrauma.Map.SelectedConnection
get

Definition at line 66 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ SelectedLocation

Location Barotrauma.Map.SelectedLocation
get

Definition at line 54 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ SelectedLocationIndex

int Barotrauma.Map.SelectedLocationIndex
get

Definition at line 56 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ StartLocation

Location Barotrauma.Map.StartLocation
get

Definition at line 45 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.

◆ Width

int Barotrauma.Map.Width
get

Definition at line 19 of file BarotraumaShared/SharedSource/Map/Map/Map.cs.