Unstable 0.17.4.0

This commit is contained in:
Markus Isberg
2022-03-30 00:08:09 +09:00
parent 2968e23ae8
commit c1b8e5a341
177 changed files with 3388 additions and 1977 deletions
@@ -156,6 +156,8 @@ namespace Barotrauma
public Dictionary<Identifier, SerializableProperty> SerializableProperties { get; private set; }
private ImmutableHashSet<Identifier> StoreIdentifiers { get; set; }
#warning TODO: this shouldn't really accept any ContentFile, issue is that RuinConfigFile and OutpostConfigFile are separate derived classes
public OutpostGenerationParams(ContentXElement element, ContentFile file) : base(file, element.GetAttributeIdentifier("identifier", ""))
{
@@ -230,6 +232,26 @@ namespace Barotrauma
return humanPrefabCollections.GetRandom(randSync);
}
public ImmutableHashSet<Identifier> GetStoreIdentifiers()
{
if (StoreIdentifiers == null)
{
var storeIdentifiers = new HashSet<Identifier>();
foreach (var collection in humanPrefabCollections)
{
foreach (var prefab in collection)
{
if (prefab?.CampaignInteractionType == CampaignMode.InteractionType.Store)
{
storeIdentifiers.Add(prefab.Identifier);
}
}
}
StoreIdentifiers = storeIdentifiers.ToImmutableHashSet();
}
return StoreIdentifiers;
}
public override void Dispose() { }
}
}