Client LuaCsForBarotrauma
MissionsFile.cs
1 using System;
2 using System.Collections.Immutable;
3 using System.Linq;
4 using System.Reflection;
5 using System.Xml.Linq;
6 
7 namespace Barotrauma
8 {
9  [RequiredByCorePackage]
10  sealed class MissionsFile : GenericPrefabFile<MissionPrefab>
11  {
12  /*private readonly static ImmutableHashSet<Type> missionTypes;
13  static MissionsFile()
14  {
15  missionTypes = ReflectionUtils.GetDerivedNonAbstract<Mission>()
16  .ToImmutableHashSet();
17  }*/
18 
19  public MissionsFile(ContentPackage contentPackage, ContentPath path) : base(contentPackage, path) { }
20 
21  protected override bool MatchesSingular(Identifier identifier)
22  => !MatchesPlural(identifier);
23  /*missionTypes.Any(t => identifier == t.Name)
24  || identifier == "OutpostDestroyMission" || identifier == "OutpostRescueMission";*/
25  protected override bool MatchesPlural(Identifier identifier) => identifier == "missions";
27  protected override MissionPrefab CreatePrefab(ContentXElement element)
28  {
29  return new MissionPrefab(element, this);
30  }
31  }
32 }
static readonly PrefabCollection< MissionPrefab > Prefabs
override bool MatchesPlural(Identifier identifier)
override bool MatchesSingular(Identifier identifier)
override MissionPrefab CreatePrefab(ContentXElement element)
Definition: MissionsFile.cs:27
MissionsFile(ContentPackage contentPackage, ContentPath path)
Definition: MissionsFile.cs:19
override PrefabCollection< MissionPrefab > Prefabs
Definition: MissionsFile.cs:26