20 lines
545 B
C#
20 lines
545 B
C#
namespace WaifuCellar.Parts;
|
|
|
|
public abstract class Part {
|
|
public abstract List<IBuff> Buffs { get; set; }
|
|
public abstract Part? ParentPart { get; set; }
|
|
// limbs
|
|
public abstract List<Part> AttachedParts { get; }
|
|
|
|
public virtual void AddPart(Part part) {
|
|
AttachedParts.Add(part);
|
|
part.ParentPart = this;
|
|
}
|
|
|
|
public virtual void RemovePart(Part part) {
|
|
AttachedParts.Remove(part);
|
|
part.ParentPart = null;
|
|
}
|
|
|
|
public virtual void RemoveSelf() => ParentPart?.RemovePart(this);
|
|
} |