Skip to content

static class ItemsGround


This class represents item ground manager.
Original: ItemsGround

Source code in src/pyg2o/classes/items.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
    async 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.
        """
        data = f'return ItemsGround.getById({id})'

        # TODO: Добавить десериализацию ItemGround
        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async 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.
        """
        data = f'return ItemsGround.create({data})'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

    @staticmethod
    async def destroy(id : int):
        """
        This method will destroy the item ground by it's unique id.
        **Parameters:**
        * `int` **itemGroundId**: the item ground unique id.
        """
        data = f'return ItemsGround.destroy({id})'

        server = await PythonWebsocketServer.get_server()
        result = await server.make_request(data)
        return result

create(data) async staticmethod

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.

Source code in src/pyg2o/classes/items.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@staticmethod
async 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.
    """
    data = f'return ItemsGround.create({data})'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result

destroy(id) async staticmethod

This method will destroy the item ground by it's unique id.
Parameters:
* int itemGroundId: the item ground unique id.

Source code in src/pyg2o/classes/items.py
49
50
51
52
53
54
55
56
57
58
59
60
@staticmethod
async def destroy(id : int):
    """
    This method will destroy the item ground by it's unique id.
    **Parameters:**
    * `int` **itemGroundId**: the item ground unique id.
    """
    data = f'return ItemsGround.destroy({id})'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result

getById(id) async staticmethod

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.

Source code in src/pyg2o/classes/items.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@staticmethod
async 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.
    """
    data = f'return ItemsGround.getById({id})'

    # TODO: Добавить десериализацию ItemGround
    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result