Client LuaCsForBarotrauma
BallastFloraPrefab.cs
1 using System;
2 using System.Collections;
3 using System.Xml.Linq;
4 
5 namespace Barotrauma
6 {
8  {
9  public string OriginalName { get; }
10  public LocalizedString DisplayName { get; }
11  public ContentXElement Element { get; }
12 
13  public bool Disposed;
14 
16 
17  public BallastFloraPrefab(ContentXElement element, BallastFloraFile file) : base(file, element.GetAttributeIdentifier("identifier", ""))
18  {
19  OriginalName = element.GetAttributeString("name", "");
20  DisplayName = TextManager.Get(Identifier).Fallback(OriginalName);
21  Element = element;
22  }
23 
24  public static BallastFloraPrefab Find(Identifier identifier)
25  {
26  return Prefabs.ContainsKey(identifier) ? Prefabs[identifier] : null;
27  }
28 
29  public override void Dispose() { }
30  }
31 }
static readonly PrefabCollection< BallastFloraPrefab > Prefabs
BallastFloraPrefab(ContentXElement element, BallastFloraFile file)
static BallastFloraPrefab Find(Identifier identifier)
string? GetAttributeString(string key, string? def)
LocalizedString Fallback(LocalizedString fallback, bool useDefaultLanguageIfFound=true)
Use this text instead if the original text cannot be found.
readonly Identifier Identifier
Definition: Prefab.cs:34