Barotrauma Server 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 ()
 

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

Public Attributes

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

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]
 

Detailed Description

Definition at line 11 of file Map.cs.

Constructor & Destructor Documentation

◆ Map() [1/2]

Barotrauma.Map.Map ( CampaignSettings  settings)

Definition at line 81 of file 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 Map.cs.

Member Function Documentation

◆ ClearLocationHistory()

void Barotrauma.Map.ClearLocationHistory ( )

Definition at line 1398 of file Map.cs.

◆ Discover()

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

Definition at line 1379 of file Map.cs.

◆ GetBiome() [1/2]

Biome Barotrauma.Map.GetBiome ( float  xPos)

Definition at line 756 of file Map.cs.

◆ GetBiome() [2/2]

Biome Barotrauma.Map.GetBiome ( Vector2  mapPos)

Definition at line 751 of file Map.cs.

◆ GetDiscoveryIndex()

int? Barotrauma.Map.GetDiscoveryIndex ( Location  location)

Definition at line 1404 of file Map.cs.

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

◆ GetSelectedMissionIndices()

IEnumerable<int> Barotrauma.Map.GetSelectedMissionIndices ( )

Definition at line 61 of file Map.cs.

◆ GetVisitIndex()

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

Definition at line 1411 of file Map.cs.

◆ IsDiscovered()

bool Barotrauma.Map.IsDiscovered ( Location  location)

Definition at line 1427 of file Map.cs.

◆ IsVisited()

bool Barotrauma.Map.IsVisited ( Location  location)

Definition at line 1433 of file Map.cs.

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

◆ LocationOrConnectionWithinDistance()

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

Definition at line 1331 of file Map.cs.

◆ MoveToNextLocation()

void Barotrauma.Map.MoveToNextLocation ( )

Definition at line 955 of file Map.cs.

◆ ProgressWorld()

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

Definition at line 1160 of file Map.cs.

◆ Remove()

void Barotrauma.Map.Remove ( )

Definition at line 1713 of file Map.cs.

◆ Save()

void Barotrauma.Map.Save ( XElement  element)

Definition at line 1634 of file Map.cs.

◆ SelectLocation() [1/2]

void Barotrauma.Map.SelectLocation ( int  index)

Definition at line 1047 of file Map.cs.

◆ SelectLocation() [2/2]

void Barotrauma.Map.SelectLocation ( Location  location)

Definition at line 1092 of file Map.cs.

◆ SelectMission()

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

Definition at line 1115 of file Map.cs.

◆ SelectRandomLocation()

void Barotrauma.Map.SelectRandomLocation ( bool  preferUndiscovered)

Definition at line 1145 of file Map.cs.

◆ SetLocation()

void Barotrauma.Map.SetLocation ( int  index)

Definition at line 1017 of file Map.cs.

◆ Visit()

void Barotrauma.Map.Visit ( Location  location)

Definition at line 1390 of file Map.cs.

Member Data Documentation

◆ AllowDebugTeleport

bool Barotrauma.Map.AllowDebugTeleport

Definition at line 13 of file Map.cs.

◆ OnLocationChanged

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

From -> To

Definition at line 40 of file Map.cs.

◆ OnLocationSelected

Action<Location, LocationConnection> Barotrauma.Map.OnLocationSelected

Definition at line 22 of file Map.cs.

◆ OnMissionsSelected

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

Definition at line 23 of file Map.cs.

◆ Radiation

Radiation Barotrauma.Map.Radiation

Definition at line 77 of file Map.cs.

Property Documentation

◆ Connections

List<LocationConnection> Barotrauma.Map.Connections
get

Definition at line 75 of file Map.cs.

◆ CurrentLocation

Location Barotrauma.Map.CurrentLocation
get

Definition at line 47 of file Map.cs.

◆ CurrentLocationIndex

int Barotrauma.Map.CurrentLocationIndex
get

Definition at line 49 of file Map.cs.

◆ EndLocations

IReadOnlyList<Location> Barotrauma.Map.EndLocations
get

Definition at line 43 of file Map.cs.

◆ Height

int Barotrauma.Map.Height
get

Definition at line 20 of file Map.cs.

◆ Locations

List<Location> Barotrauma.Map.Locations
get

Definition at line 70 of file Map.cs.

◆ Seed

string Barotrauma.Map.Seed
get

Definition at line 68 of file Map.cs.

◆ SelectedConnection

LocationConnection Barotrauma.Map.SelectedConnection
get

Definition at line 66 of file Map.cs.

◆ SelectedLocation

Location Barotrauma.Map.SelectedLocation
get

Definition at line 54 of file Map.cs.

◆ SelectedLocationIndex

int Barotrauma.Map.SelectedLocationIndex
get

Definition at line 56 of file Map.cs.

◆ StartLocation

Location Barotrauma.Map.StartLocation
get

Definition at line 45 of file Map.cs.

◆ Width

int Barotrauma.Map.Width
get

Definition at line 19 of file Map.cs.