feat: Added Way class

This commit is contained in:
AURUMVORXX
2024-11-11 11:32:10 +03:00
parent 2e83646914
commit b199563943
8 changed files with 142 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ from g2o.classes.items import ItemsGround
from g2o.classes.daedalus import Daedalus
from g2o.classes.sky import Sky
from g2o.classes.mds import Mds
from g2o.classes.way import Way
from g2o.functions.chat import sendMessageToAll
from g2o.functions.chat import sendMessageToPlayer

48
g2o/classes/way.py Normal file
View File

@@ -0,0 +1,48 @@
import sqg2o
class Way(sqg2o.Way):
"""
This class represents Way constructed from waypoints.
Original: [Way](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/waypoint/Way/)
## `str` start *(read-only)*
Represents the start waypoint for Way.
## `str` end *(read-only)*
Represents the end waypoint for Way.
"""
def __init__(self, world : str, startWp : str, endWp : str):
"""
## Parameters
`str` **world**: the name of the world from config.xml.
`str` **startWp**: the name of the start waypoint.
`str` **endWp**: the name of the end waypoint.
"""
return super().__init__(world, startWp, endWp)
def getWaypoints(self) -> list:
"""
This method will get the all waypoints between startWp & endWp.
## Returns
`list [str]`: the list containing the names of all of the Way waypoints.
"""
return super().getWaypoints()
def getCountWaypoints(self):
"""
This method will get the number of waypoints between start waypoint & end waypoint.
## Returns
`int`: the number of waypoints.
"""
return super().getCountWaypoints()
@property
def start(self):
return super().start
@property
def end(self):
return super().end