Skip to content

Commit

Permalink
[python] add: scripts to regen stubs
Browse files Browse the repository at this point in the history
[python] chore: regenerate stubs
[python] chore: cleanup the organization of the py, impl, and binding file.
  • Loading branch information
jd28 committed Jan 10, 2025
1 parent ecf7065 commit ac7d16c
Show file tree
Hide file tree
Showing 15 changed files with 2,153 additions and 3,149 deletions.
30 changes: 19 additions & 11 deletions docs/fake/rollnw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import enum
from enum import auto
from enum import auto, IntFlag
from typing import NewType, Tuple, List, ClassVar, Optional, ByteString, DefaultDict


Expand Down Expand Up @@ -1097,7 +1097,7 @@ def set(self, row: int, column: int | str, value: int | float | str):
pass

@staticmethod
def from_string(string: str) -> TwoDA:
def from_string(string: str) -> 'TwoDA':
pass


Expand Down Expand Up @@ -2258,6 +2258,14 @@ class AttackResult(enum.IntEnum):
miss_by_roll = auto()


class DamageCategory(IntFlag):
"""Represents categories of damage with bitwise support."""
none = 0
penalty = 1 << 0
critical = 1 << 1
unblockable = 1 << 2


class DiceRoll:
"""Dice roll
"""
Expand Down Expand Up @@ -2299,39 +2307,39 @@ def clear(self):
"""Clears the effect such that it's as if default constructed"""
pass

def get_float(self, index):
def get_float(self, index: int) -> float:
"""Gets a floating point value"""
pass

def get_int(self, index):
def get_int(self, index: int) -> int:
"""Gets an integer point value"""
pass

def get_string(self, index):
def get_string(self, index: int) -> str:
"""Gets a string value"""
pass

def handle(self):
def handle(self) -> EffectHandle:
"""Gets the effect's handle"""
pass

def id(self):
def id(self) -> EffectID:
"""Gets the effect's ID"""
pass

def set_float(self, index: int, value: float):
def set_float(self, index: int, value: float) -> None:
"""Sets a floating point value"""
pass

def set_int(self, index: int, value: int):
def set_int(self, index: int, value: int) -> None:
"""Sets an integer point value"""
pass

def set_string(self, index: int, value: str):
def set_string(self, index: int, value: str) -> None:
"""Sets a string value"""
pass

def set_versus(self, vs):
def set_versus(self, vs) -> None:
"""Sets the versus value"""
pass

Expand Down
13 changes: 9 additions & 4 deletions docs/fake/rollnw/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ def load_module(path: str, instantiate: bool = True) -> Module:
pass


def effects():
def effects() -> EffectSystem:
"""Gets effects service"""
pass


def objects():
def objects() -> Objects:
"""Gets objects service"""
pass

Expand All @@ -235,7 +235,7 @@ def resman() -> Resources:
pass


def rules():
def rules() -> Rules:
"""Gets rules service"""
pass

Expand All @@ -250,11 +250,16 @@ def start(options: Optional[ConfigOptions]):
pass


def strings():
def strings() -> Strings:
"""Gets strings service"""
pass


def twodas() -> TwoDACache:
"""Gets TwoDA Cache service"""
pass


def unload_module() -> None:
"""Unloads the currently loaded module
"""
Expand Down
12 changes: 6 additions & 6 deletions docs/fake/rollnw/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import enum
from enum import auto
from typing import Tuple, List, ClassVar, Optional
from typing import Tuple, List, ClassVar, Optional, Iterator

from . import (
IVector4,
Expand Down Expand Up @@ -397,15 +397,15 @@ class MdlModel(MdlGeometry):
supermodel_name: str
file_dependency: str

def animation_count(self):
def animation_count(self) -> int:
"""Gets the number of animations"""
pass

def animations(self):
def animations(self) -> Iterator[MdlAnimation]:
"""Gets an iterator of animations"""
pass

def get_animation(self, index: int):
def get_animation(self, index: int) -> MdlAnimation:
"""Gets an animation"""
pass

Expand All @@ -416,11 +416,11 @@ class Mdl:
#: The parsed model
model: MdlModel

def valid(self):
def valid(self) -> bool:
"""Determines if file was successfully parsed"""
pass

@staticmethod
def from_file(path):
def from_file(path) -> 'Mdl':
"""Loads mdl file from file path"""
pass
Loading

0 comments on commit ac7d16c

Please sign in to comment.