def addRadioButtonsOption(values, text: str = ''): return Main.addOption(('radioButtons', (values, str), text))
def getThisPlayerIndex(): Main.getGameObject().thisPlayerIndex
def showMessageLaterForAll(title, text): return Main.showMessageLater(title, text, all=True)
def addCheckBoxOption(text: str, defaultValue: bool = False): return Main.addOption(('checkBox', text, defaultValue))
def getCurrentPlayerIndex(): return Main.getGameObject().currentPlayerIndex
def showMessageLater(title, text): return Main.showMessageLater(title, text, all=False)
def getPlayerTitles(): return Main.getGameObject().playerTitles
def getPlayerNames(): return Main.getGameObject().players
def getPlayerCount(): return Main.getGameObject().getPlayerCount()
def run(gameName=None, minPlayerCount=2, maxPlayerCount=2, players=None, autoStart=False, playerTitles=None, \ titlesAreChoosable=False, hostGame=False, hostingName=None, sessionSecret=None): Main.run(locals())
# class Option: # def __init__(self): # self.value = None # adds a checkbox option - text will be shown next to the checkbox # value will be True if checked and False otherwise def addCheckBoxOption(text: str, defaultValue: bool = False): return Main.addOption(('checkBox', text, defaultValue)) # add several radio buttons - values must be a list of strings which will be shown next to the buttons # text is an optional string shown above the buttons # value will be the text of the selected button def addRadioButtonsOption(values, text: str = ''): return Main.addOption(('radioButtons', (values, str), text)) ##################### releveant for network mode only! ##################### # in local mode same as getCurrentPlayerIndex(), in network mode the index of the player # who runs the participating program, thus it does not change in network mode throughout the game! def getThisPlayerIndex(): Main.getGameObject().thisPlayerIndex # when running this file directly the directory will be searched for games and you can select among the found games if __name__ == "__main__": Main.selectGame()