diff --git a/docs/code_structure.md b/docs/code_structure.md index b790061..5616e7f 100644 --- a/docs/code_structure.md +++ b/docs/code_structure.md @@ -8,7 +8,7 @@ -- can return applicable list based on item type [class] Environment - [dict] Environment Configuration + [set] Environment Configuration [class] Build [ref] Tree @@ -16,16 +16,17 @@ [class] Tree [str] version - [dict] All Nodes (addressable by Node ID) - [dict] Selected Nodes (addressable by Node ID) + [set] All Nodes (addressable by Node ID) + [set] Allocated Nodes (addressable by Node ID) [class] Player [enum] Class Selection [enum] Ascendancy Selection - [dict] Stats (e.g. Str/Dex/Int, Hit/Crit, Life/Mana, Block/Spell Block/Evade/Dodge, etc.) - [dict] Item Slots + [set] Stats (e.g. Str/Dex/Int, Hit/Crit, Life/Mana, Block/Spell Block/Evade/Dodge, etc.) + [list] Skills + [set] Item Sets [per slot ref] Item - [optional list] Minions + [optional set] Minions [class] Item [dict] Attribute requirements @@ -43,24 +44,26 @@ [class] Minion [ref] Player - [dict] Stats + [set] Stats [ref list] Items [ref list] Skills [int] Quantity [class] EnemyModel (e.g. Shaper, Maven) - [dict] Stats (e.g. Str/Dex/Int, Hit/Crit, Life/Mana, Block/Spell Block/Evade/Dodge, etc.) + [str] Name + [set] Stats (e.g. Str/Dex/Int, Hit/Crit, Life/Mana, Block/Spell Block/Evade/Dodge, etc.) [class] Simulator [ref] Environment(s) [ref list] Build(s) [ref] Enemy Model(s) -[class] Analytics Module +[module] Analytics Module [func] Node Comparison [func] Item Comparison [func] Gem Comparison + [func] Minion Comparison -[list] Saved Builds +[set] Saved Builds [dict] UI API imports/exports diff --git a/src/Build.py b/src/Build.py new file mode 100755 index 0000000..71e07a1 --- /dev/null +++ b/src/Build.py @@ -0,0 +1,36 @@ +""" +Build Class + +The build class is the top-level class encompassing all attributes and +parameters defining a build. It is defined by a specific Tree and Player +instance at time of evaluation. + +The intent is that there is only one Build for a character. There might be +numerous Passive Trees (at various Player Levels, or various Cluster Jewels) +associated with a Player. +""" + +import Tree +import Player + + +class Build: + def __init__(self, name: str = "temp") -> None: + self.name = name + self.tree = Tree.Tree() + self.player = Player.Player() + + def __repr__(self) -> str: + ret_str = f"[BUILD]: '{self.name}'\n" + ret_str += f"{self.tree}" + ret_str += f"{self.player}" + return ret_str + + +def test() -> None: + build = Build() + print(build) + + +if __name__ == "__main__": + test() diff --git a/src/Enumerations.py b/src/Enumerations.py new file mode 100644 index 0000000..9670ec5 --- /dev/null +++ b/src/Enumerations.py @@ -0,0 +1,17 @@ +# Enumeration Data for Path of Exile constants + +from enum import Enum + + +class PlayerClasses(Enum): + SCION = 0 + MARAUDER = 1 + RANGER = 2 + WITCH = 3 + DUELIST = 4 + TEMPLAR = 5 + SHADOW = 6 + + +class PlayerAscendancies(Enum): + NONE = None diff --git a/src/Player.py b/src/Player.py new file mode 100755 index 0000000..b4816b4 --- /dev/null +++ b/src/Player.py @@ -0,0 +1,41 @@ +""" +Player Class + +The Player represents an in-game character at a specific point in their +leveling progress. + +A unique Player is defined by: level, class selection, ascendancy selection, +skill selection, and itemization across the item sets. +""" + +from Enumerations import PlayerClasses, PlayerAscendancies + + +class Player: + def __init__( + self, + player_class: PlayerClasses = PlayerClasses.SCION, + ascendancy: PlayerAscendancies = PlayerAscendancies.NONE, + level: int = 1, + ) -> None: + self.player_class = player_class + self.ascendancy = ascendancy + self.level = level + self.stats = set() + self.skills = list() + self.item_sets = set() + self.minions = set() + + def __repr__(self) -> str: + ret_str = f"Level {self.level} {self.player_class.name}" + ret_str += f" {self.ascendancy.value}\n" if self.ascendancy.value else "\n" + return ret_str + + +def test() -> None: + player = Player() + print(player) + + +if __name__ == "__main__": + test() diff --git a/src/Tree.py b/src/Tree.py new file mode 100755 index 0000000..8ab8f73 --- /dev/null +++ b/src/Tree.py @@ -0,0 +1,33 @@ +""" +Tree Class + +This class represents an instance of the Passive Tree for a given Build. +Multiple Trees can exist in a single Build (at various progress levels; +at different Jewel/Cluster itemizations, etc.) + +A Tree is tied to a Version of the Tree as released by GGG and thus older Trees +need to be supported for backwards compatibility reason. + +""" + +_VERSION_ = "3.17" + + +class Tree: + def __init__(self, version: str = _VERSION_) -> None: + self.version = version + self.tree_nodes = set() + self.allocated_nodes = set() + + def __repr__(self) -> str: + ret_str = f"[TREE]: version '{self.version}'\n" + return ret_str + + +def test() -> None: + tree = Tree() + print(tree) + + +if __name__ == "__main__": + test() diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29