Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/Source/Map/Map/Location.cs
T
juanjp600 4d225c65f2 Updated to MonoGame 3.6 + Directory refactor
- Barotrauma's projects are in the Barotrauma directory
- All libraries are in the Libraries directory
- MonoGame is now managed by NuGet, rather than referenced from the installed files (TODO: consider using PCL for easier cross-platform development?)
- NuGet libraries are not included in the repo, as getting the latest versions automatically should be preferred
- Removed Content/effects.mgfx as it didn't seem to be used anywhere
- Removed some references to Subsurface directory
- Renamed Launcher2 to Launcher
2017-06-27 09:52:57 -03:00

65 lines
1.5 KiB
C#

using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace Barotrauma
{
partial class Location
{
private string name;
private Vector2 mapPosition;
private LocationType type;
public List<LocationConnection> Connections;
public string Name
{
get { return name; }
}
public Vector2 MapPosition
{
get { return mapPosition; }
}
public bool Discovered;
public LocationType Type
{
get { return type; }
}
public Location(Vector2 mapPosition)
{
this.type = LocationType.Random();
this.name = RandomName(type);
this.mapPosition = mapPosition;
#if CLIENT
if (type.HasHireableCharacters)
{
hireManager = new HireManager();
hireManager.GenerateCharacters(this, HireManager.MaxAvailableCharacters);
}
#endif
Connections = new List<LocationConnection>();
}
public static Location CreateRandom(Vector2 position)
{
return new Location(position);
}
private string RandomName(LocationType type)
{
string randomName = ToolBox.GetRandomLine("Content/Map/locationNames.txt");
int nameFormatIndex = Rand.Int(type.NameFormats.Count, Rand.RandSync.Server);
return type.NameFormats[nameFormatIndex].Replace("[name]", randomName);
}
}
}