Skip to main content

ProgressionSlot

A class in Root.Township, the global namespace.

One slot in a profession skill tree: a skill, its cost in points, and the slots it depends on. The tree's Validate fills in the hash and path.

Constructors​

MemberWhat it is
ProgressionSlot()Creates a ProgressionSlot from skill.
ProgressionSlot(ProfessionSkill skill)Creates a ProgressionSlot from skill.

Fields​

9 private and internal fields
MemberWhat it is
private uint costBacking field for Cost: skill points needed to buy the slot. 1 by default.
private List<uint> dependenciesBacking field for Dependencies: hashes of slots that must be owned first.
private uint hashBacking field for Hash. Made on validate from the skill's hash plus its dependencies' hashes (or a random number).
private int indentLevelCached depth in the tree: one more than the deepest dependency. -1 until worked out.
private List<ProgressionSlot> inheritSlotsBacking field for InheritSlots: slots that depend on this one. Not serialized; filled by AddInherit.
private string nameBacking field for Name. Defaults to the skill's name.
private Vector3 positionBacking field for Position, the slot's place in the skill tree layout.
private ProfessionSkill skillBacking field for Skill, the skill this slot grants.
private Texture2D slotIconBacking field for SlotIcon.

Properties​

MemberWhat it is
uint Cost { get; }Skill points needed to buy it. Default 1.
List<uint> Dependencies { get; }Hashes of the slots that must come first.
uint Hash { get; }Identifier saved with a player's progress. Made from the skill hash and its dependencies.
IEnumerable<ProgressionSlot> InheritSlots { get; }Slots that depend on this one.
string Name { get; }Display name. Defaults to the skill's name.
ProgressionPath Path { get; set; }The progression path (such as mining or forging) this slot belongs to.
Vector3 Position { get; }Position of the slot on the skill tree board.
ProfessionSkill Skill { get; }The skill this slot unlocks.
Texture2D SlotIcon { get; }Icon shown for the slot.

Methods​

MemberWhat it is
void AddInherit(ProfessionSkillTree tree)Registers this slot as a follow-on of each slot it depends on.
void ForceChange()Nudges the hash by a random amount, giving the slot a new identity.
int GetIndentLevel(ProfessionSkillTree skillTree)Depth in the tree: one more than its deepest dependency. Cached.
void Validate(ProfessionSkillTree skillTree)Fills in a missing hash and name, sets the path from the tree and recalculates the indent level.

Used in​

Members of other types that take, return or hold a ProgressionSlot: