Client LuaCsForBarotrauma
UpgradeModulesFile.cs
1 using System.Xml.Linq;
2 
3 namespace Barotrauma
4 {
5  [RequiredByCorePackage]
6  sealed class UpgradeModulesFile : GenericPrefabFile<UpgradeContentPrefab>
7  {
8  public UpgradeModulesFile(ContentPackage contentPackage, ContentPath path) : base(contentPackage, path) { }
9 
10  protected override bool MatchesSingular(Identifier identifier) =>
11  identifier == "upgrademodule" ||
12  identifier == "upgradecategory";
13 
14  protected override bool MatchesPlural(Identifier identifier) =>
15  identifier == "upgrademodules";
16 
19  {
20  Identifier elemName = element.NameAsIdentifier();
21  if (elemName == "upgradecategory")
22  {
23  return new UpgradeCategory(element, this);
24  }
25  else
26  {
27  return new UpgradePrefab(element, this);
28  }
29  }
30  }
31 }
Identifier NameAsIdentifier()
static readonly PrefabCollection< UpgradeContentPrefab > PrefabsAndCategories
override bool MatchesPlural(Identifier identifier)
override UpgradeContentPrefab CreatePrefab(ContentXElement element)
override PrefabCollection< UpgradeContentPrefab > Prefabs
UpgradeModulesFile(ContentPackage contentPackage, ContentPath path)
override bool MatchesSingular(Identifier identifier)