Esempio n. 1
0
    def __init__(self, connection, runtime, account_id, universe_id):
        """
        MenuController is used for the main menu where the user can choose which universe to join or
        create a new universe.

        :param connection: Connection of the user
        :param account: Account of user user
        :param universe: Universe where the play happens
        :type connection: main.Connection
        :type account: models.account.Account
        :type universe: models.universe.Universe
        :return:
        """
        BaseController.__init__(self, connection, runtime)
        self.account_id = account_id
        self.universe_id = universe_id
        self.state = State.normal

        #self.thing = get(account for account in self.universe.things if account == self.account)
        #if not self.thing:
        #    self.thing = Thing(account=self.account, universe=self.universe)
        #    # TODO place!

        runtime.add_controller(universe_id, account_id, self)

        self.being_id = None
        self.start()
Esempio n. 2
0
 def __init__(self, connection, runtime):
     BaseController.__init__(self, connection, runtime)
     self.account_id = None
     self.account_name = None
     # self.account = None
     self.state = State.login_username
     self.static_salt = None
     self.dynamic_salt = None
     self.password = None  # For creating a new account, store the password temporarily
     self.greeting()
Esempio n. 3
0
    def __init__(self, connection, runtime, account_id):
        """
        MenuController is used for the main menu where the user can choose which universe to join or
        create a new universe.

        :param connection: Connection of the user
        :param account: Account of user user
        :type connection: main.Connection
        :type account: models.account.Account
        :return:
        """
        BaseController.__init__(self, connection, runtime)
        self.account_id = account_id
        self.state = State.main_menu
        self.main_menu_view()