Client LuaCsForBarotrauma
CorpsePrefab.cs
3 using System;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Xml.Linq;
7 
8 namespace Barotrauma
9 {
11  {
13 
14  public override void Dispose() { }
15 
16  public static CorpsePrefab Get(Identifier identifier)
17  {
18  if (Prefabs == null)
19  {
20  DebugConsole.ThrowError("Issue in the code execution order: job prefabs not loaded.");
21  return null;
22  }
23  if (Prefabs.ContainsKey(identifier))
24  {
25  return Prefabs[identifier];
26  }
27  else
28  {
29  DebugConsole.ThrowError("Couldn't find a job prefab with the given identifier: " + identifier);
30  return null;
31  }
32  }
33 
35  public Level.PositionType SpawnPosition { get; private set; }
36 
38  public int MinMoney { get; private set; }
39 
41  public int MaxMoney { get; private set; }
42 
43  public CorpsePrefab(ContentXElement element, CorpsesFile file) : base(element, file, npcSetIdentifier: Identifier.Empty) { }
44 
45  public static CorpsePrefab Random(Rand.RandSync sync = Rand.RandSync.Unsynced) => Prefabs.GetRandom(sync);
46  }
47 }
CorpsePrefab(ContentXElement element, CorpsesFile file)
Definition: CorpsePrefab.cs:43
static readonly PrefabCollection< CorpsePrefab > Prefabs
Definition: CorpsePrefab.cs:12
override void Dispose()
Definition: CorpsePrefab.cs:14
Level.PositionType SpawnPosition
Definition: CorpsePrefab.cs:35
static CorpsePrefab Get(Identifier identifier)
Definition: CorpsePrefab.cs:16
static CorpsePrefab Random(Rand.RandSync sync=Rand.RandSync.Unsynced)
readonly Identifier Identifier
Definition: Prefab.cs:34