Client LuaCsForBarotrauma
SkillSettingsFile.cs
1
using
System.Xml.Linq;
2
3
namespace
Barotrauma
4
{
5
sealed
class
SkillSettingsFile
:
ContentFile
6
{
7
public
SkillSettingsFile
(
ContentPackage
contentPackage,
ContentPath
path) : base(contentPackage, path) { }
8
9
public
override
void
LoadFile
()
10
{
11
XDocument doc = XMLExtensions.TryLoadXml(Path);
12
if
(doc ==
null
) {
return
; }
13
var mainElement = doc.Root.FromPackage(
ContentPackage
);
14
bool
allowOverriding = mainElement.IsOverride();
15
if
(allowOverriding)
16
{
17
mainElement = mainElement.FirstElement();
18
}
19
var prefab =
new
SkillSettings
(mainElement,
this
);
20
SkillSettings
.
Prefabs
.Add(prefab, allowOverriding);
21
}
22
23
public
override
void
UnloadFile
()
24
{
25
SkillSettings
.
Prefabs
.RemoveByFile(
this
);
26
}
27
28
public
override
void
Sort
()
29
{
30
SkillSettings
.
Prefabs
.Sort();
31
}
32
}
33
}
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.SkillSettingsFile
Definition:
SkillSettingsFile.cs:6
Barotrauma.SkillSettingsFile.SkillSettingsFile
SkillSettingsFile(ContentPackage contentPackage, ContentPath path)
Definition:
SkillSettingsFile.cs:7
Barotrauma.SkillSettingsFile.Sort
override void Sort()
Definition:
SkillSettingsFile.cs:28
Barotrauma.SkillSettingsFile.UnloadFile
override void UnloadFile()
Definition:
SkillSettingsFile.cs:23
Barotrauma.SkillSettingsFile.LoadFile
override void LoadFile()
Definition:
SkillSettingsFile.cs:9
Barotrauma.SkillSettings
Definition:
SkillSettings.cs:9
Barotrauma.SkillSettings.Prefabs
static readonly PrefabSelector< SkillSettings > Prefabs
Definition:
SkillSettings.cs:10
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaShared
SharedSource
ContentManagement
ContentFile
SkillSettingsFile.cs
Generated by
1.9.1