Client LuaCsForBarotrauma
MapGenerationParametersFile.cs
1
using
System.Xml.Linq;
2
3
namespace
Barotrauma
4
{
5
sealed
class
MapGenerationParametersFile
:
ContentFile
6
{
7
public
MapGenerationParametersFile
(
ContentPackage
contentPackage,
ContentPath
path) : base(contentPackage, path) { }
8
9
public
override
void
LoadFile
()
10
{
11
XDocument doc = XMLExtensions.TryLoadXml(Path);
12
if
(doc ==
null
)
13
{
14
DebugConsole.ThrowError($
"Loading map generation parameters file failed: {Path}"
);
15
return
;
16
}
17
var mainElement = doc.Root.FromPackage(
ContentPackage
);
18
bool
isOverride = mainElement.IsOverride();
19
if
(isOverride) { mainElement = mainElement.FirstElement(); }
20
var prefab =
new
MapGenerationParams
(mainElement,
this
);
21
MapGenerationParams
.
Params
.Add(prefab, isOverride);
22
}
23
24
public
override
void
UnloadFile
()
25
{
26
MapGenerationParams
.
Params
.RemoveByFile(
this
);
27
}
28
29
public
override
void
Sort
()
30
{
31
MapGenerationParams
.
Params
.Sort();
32
}
33
}
34
}
Barotrauma.ContentFile
Base class for content file types, which are loaded from filelist.xml via reflection....
Definition:
ContentFile.cs:23
Barotrauma.ContentPackage
Definition:
ContentPackage.cs:18
Barotrauma.ContentPath
Definition:
ContentPath.cs:11
Barotrauma.MapGenerationParametersFile
Definition:
MapGenerationParametersFile.cs:6
Barotrauma.MapGenerationParametersFile.Sort
override void Sort()
Definition:
MapGenerationParametersFile.cs:29
Barotrauma.MapGenerationParametersFile.UnloadFile
override void UnloadFile()
Definition:
MapGenerationParametersFile.cs:24
Barotrauma.MapGenerationParametersFile.LoadFile
override void LoadFile()
Definition:
MapGenerationParametersFile.cs:9
Barotrauma.MapGenerationParametersFile.MapGenerationParametersFile
MapGenerationParametersFile(ContentPackage contentPackage, ContentPath path)
Definition:
MapGenerationParametersFile.cs:7
Barotrauma.MapGenerationParams
Definition:
MapGenerationParams.cs:11
Barotrauma.MapGenerationParams.Params
static readonly PrefabSelector< MapGenerationParams > Params
Definition:
MapGenerationParams.cs:12
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaShared
SharedSource
ContentManagement
ContentFile
MapGenerationParametersFile.cs
Generated by
1.9.1