feat: Added python binding to all functions

+ added docs to all functions
This commit is contained in:
AURUMVORXX
2024-11-09 20:16:25 +03:00
parent c561368b4f
commit ae0889e927
162 changed files with 2725 additions and 51 deletions

View File

@@ -1,17 +1,49 @@
import sqg2o
class ItemsGround:
"""
This class represents item ground manager.
Original: [ItemsGround](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/item/ItemsGround/)
"""
@staticmethod
def getById(id : int):
"""
This method will retrieve the item ground object by its unique id.
**Parameters:**
* `int` **itemGroundId**: the unique item ground id.
**Returns `ItemGround`:**
the item ground object or `throws an exception` if the object cannot be found.
"""
return sqg2o.ItemsGround.getById(id)
@staticmethod
def create(data : dict) -> int:
"""
This method will create the item ground.
**Parameters:**
* `dict {instance, amount=1, physicsEnabled=false position={x=0,y=0,z=0}, rotation={x=0,y=0,z=0}, world=CONFIG_WORLD, virtualWorld=0}`:
* `string` **instance**: the scripting instance of game item.
* `bool` **physicsEnabled**: the physics state of the item ground.
* `dict {x, y, z}` **position**: the position of the item ground in the world.
* `dict {x, y, z}` **rotation**: the rotation of the item ground in the world.
* `string` **world**: the world the item ground is in (.ZEN file path).
* `int` **virtualWorld**: the virtual world id in range <0, 65535>.
**Returns `int`:**
the item ground id.
"""
return sqg2o.ItemsGround.create(data)
@staticmethod
def destroy(id : int):
"""
This method will destroy the item ground by it's unique id.
**Parameters:**
* `int` **itemGroundId**: the item ground unique id.
"""
sqg2o.ItemsGround.destroy(id)
class ItemGround(sqg2o.ItemGround):

View File

@@ -1,11 +1,30 @@
import sqg2o
class Mds:
"""
This class represents mds manager for conversion between mds id & mds instance. This manager will work for every registered mds in `mds.xml` file.
Original: [Mds](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-classes/mds/Mds/)
"""
@staticmethod
def id(mdsName : str) -> int:
"""
This method will convert the mds name to mds id.
**Parameters:**
* `str` **mdsName**: the mds name, e.g: `"HumanS_Sprint.mds"`.
**Returns `int`:**
the unique mds id.
"""
return sqg2o.Mds.id(mdsName)
@staticmethod
def name(mdsId : id) -> str:
def name(mdsId : int) -> str:
"""
This method will convert the mds id to mds name.
**Parameters:**
* `int` **mdsId**: the mds id.
**Returns `str`:**
the mds name, e.g: `"HumanS_Sprint.mds"`.
"""
return sqg2o.Mds.name(mdsId)