Client LuaCsForBarotrauma
BarotraumaShared/SharedSource/Items/Components/Ladder.cs
1 using System.Collections.Generic;
2 using System.Xml.Linq;
3 
5 {
6  partial class Ladder : ItemComponent
7  {
8  public static List<Ladder> List { get; } = new List<Ladder>();
9 
10  public Ladder(Item item, ContentXElement element)
11  : base(item, element)
12  {
13  InitProjSpecific(element);
14  List.Add(this);
15  }
16 
17  partial void InitProjSpecific(ContentXElement element);
18 
19  public override bool Select(Character character)
20  {
21  if (character == null || character.LockHands || character.Removed || !(character.AnimController is HumanoidAnimController)) return false;
22  character.AnimController.StartClimbing();
23  return true;
24  }
25 
26  protected override void RemoveComponentSpecific()
27  {
28  base.RemoveComponentSpecific();
29  RemoveProjSpecific();
30  List.Remove(this);
31  }
32 
33  partial void RemoveProjSpecific();
34  }
35 }
The base class for components holding the different functionalities of the item