Reapply "OBT1.1.0 Merge branch 'dev_pte' into dev"
This reverts commit 046483b9da.
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Ladder : ItemComponent
|
||||
{
|
||||
public static List<Ladder> List { get; } = new List<Ladder>();
|
||||
private static readonly ConcurrentDictionary<Ladder, byte> _ladderDict = new ConcurrentDictionary<Ladder, byte>();
|
||||
public static IEnumerable<Ladder> List => _ladderDict.Keys;
|
||||
|
||||
public Ladder(Item item, ContentXElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
InitProjSpecific(element);
|
||||
List.Add(this);
|
||||
_ladderDict.TryAdd(this, 0);
|
||||
}
|
||||
|
||||
partial void InitProjSpecific(ContentXElement element);
|
||||
@@ -28,7 +30,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
base.RemoveComponentSpecific();
|
||||
RemoveProjSpecific();
|
||||
List.Remove(this);
|
||||
_ladderDict.TryRemove(this, out _);
|
||||
}
|
||||
|
||||
partial void RemoveProjSpecific();
|
||||
|
||||
Reference in New Issue
Block a user