Class InventoryTree
java.lang.Object
studio.magemonkey.fabled.tree.SkillTree
studio.magemonkey.fabled.tree.basic.InventoryTree
- Direct Known Subclasses:
BasicHorizontalTree,BasicVerticalTree,CustomTree,FloodTree,LevelTree,RequirementTree
A skill tree manager for classes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Comparator<Skill> Comparator for skills for most treesprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarrange()Arranges the skill treebooleancheckClick(int slot) Checks a click for actionsintorg.bukkit.inventory.InventorygetInventory(PlayerData player) Generates a new skill tree inventorygetSkill(int slot) Gets the skill attached to a slotRetrieves the entire map of occupied skill slots for the skill treebooleanChecks if the class has the skill registeredbooleanisSkill(org.bukkit.entity.HumanEntity player, int slot) Checks if the slot points to a skillvoidshow(org.bukkit.entity.Player player) Shows the player the skill tree so they can view/manage their skills.voidupdate(PlayerData player) Updates a skill in the view
-
Field Details
-
comparator
Comparator for skills for most trees -
skillSlots
-
height
protected int height
-
-
Constructor Details
-
InventoryTree
Constructor- Parameters:
api- api reference
-
-
Method Details
-
show
public void show(org.bukkit.entity.Player player) Shows the player the skill tree so they can view/manage their skills.- Parameters:
player- player to show
-
getInventory
Generates a new skill tree inventory- Parameters:
player- player data to show- Returns:
- skill tree inventory
-
checkClick
public boolean checkClick(int slot) Checks a click for actions- Parameters:
slot- slot that was clicked- Returns:
- whether the click should be cancelled (when it was a skill or link)
-
isSkill
public boolean isSkill(org.bukkit.entity.HumanEntity player, int slot) Checks if the slot points to a skill- Parameters:
slot- slot to check- Returns:
- true if a skill, false otherwise
-
getSkill
Gets the skill attached to a slot- Parameters:
slot- slot to retrieve for- Returns:
- skill for the slot
-
getSkillSlots
Retrieves the entire map of occupied skill slots for the skill tree- Returns:
- map of occupied skill slots
-
getHeight
public int getHeight() -
arrange
Arranges the skill tree- Overrides:
arrangein classSkillTree- Throws:
SkillTreeException
-
update
Updates a skill in the view- Parameters:
player- player
-
hasSkill
Checks if the class has the skill registered
-