Пример #1
0
 def __str__(self):
     if self.value == self._None.value:
         return str()
     elif self.value == self.Day.value:
         return nameof(self.Day)
     elif self.value == self.Night.value:
         return nameof(self.Night)
     else:
         raise GameException("Unknown turn cycle type used.")
Пример #2
0
    def __str__(self):
        if self.value == self._None.value:
            return str()

        elif self.value == self.Villagers.value:
            return nameof(self.Villagers)

        elif self.value == self.Werewolves.value:
            return nameof(self.Werewolves)
        else:
            raise GameException("Unknown faction type used.")
Пример #3
0
    def __init__(self, root, context):
        super().__init__(root, context)

        self.InitializeScreen()

        self.__connectButton = self.GetObject(
            nameof(self.Context.ServiceContext.Connect))
        self.__userName = self.GetVariable(nameof(self.Client.Name))
        self.__userName.set((self.Client.Name if self.Client.Name else "N/A"))

        self.UpdateConnectButton()
Пример #4
0
 def __str__(self):
     if self.value == self._None.value:
         return str()
     elif self.value == self.Villager.value:
         return nameof(self.Villager)
     elif self.value == self.Werewolf.value:
         return nameof(self.Werewolf)
     elif self.value == self.Seer.value:
         return nameof(self.Seer)
     elif self.value == self.Guard.value:
         return nameof(self.Guard)
     else:
         raise GameException("Unknown player type used.")
Пример #5
0
 def __str__(self):
     if self.value == self._None.value:
         return str()
     elif self.value == self.Introduction.value:
         return nameof(self.Introduction);
     elif self.value == self.Discussion.value:
         return nameof(self.Discussion);
     elif self.value == self.Event.value:
         return nameof(self.Event);
     elif self.value == self.Accusation.value:
         return nameof(self.Accusation);
     elif self.value == self.Voting.value:
         return nameof(self.Voting);
     else:
         raise GameException("Unknown turn phase type used.");
Пример #6
0
    def __init__(self, root, context):
        super().__init__(root, context);
        self.InitializeScreen();

        self.__playersListBox = self.GetObject("PlayerListBox");
        self.__playersScrollBar = self.GetObject("PlayersScrollbar");
        self.__playersColumnId = "PlayersColumn";

        self.__playersListBox.config(yscrollcommand = self.__playersScrollBar.set);
        self.__playersScrollBar.config(command = self.__playersListBox.yview);

        # would go into it with no gains to do it whatsoever.
        self.__messagesListBox = self.GetObject("MessagesListBox");
        self.__messagesScrollBar = self.GetObject("MessagesScrollbar");

        self.__talkMessagesMenu = None;
        self.__whisperMessagesMenu = None;
        self.__addAgentMenu = None;

        self.__gameName = self.GetVariable("GameName");
        self.__gameTurn = self.GetVariable("GameTurn");
        self.__gameTime = self.GetVariable("GameTime");
        self.__playerRole = self.GetVariable("RoleType");
        self.__playerRoleState = self.GetVariable("RoleState");

        self.__validTimeOfDayValues = TimeOfDayEnum.Values();

        self.__messagesListBox.config(yscrollcommand = self.__messagesScrollBar.set);
        self.__messagesScrollBar.config(command = self.__messagesListBox.yview);

        self.__villagerButtons = self.GetObject(str(PlayerTypeEnum.Villager));
        self.__villagerDayButtons = self.GetObject(str(PlayerTypeEnum.Villager) + str(TimeOfDayEnum.Day));
        self.__werewolfButtons = self.GetObject(str(PlayerTypeEnum.Werewolf));
        self.__seerButtons = self.GetObject(str(PlayerTypeEnum.Seer));
        self.__guardButtons = self.GetObject(str(PlayerTypeEnum.Guard));

        self.__addAgentButton = self.GetObject("AddAgentButton");
        self.__removeAgentButton = self.GetObject("RemoveAgentButton");

        self.__isReadyButton = self.GetObject(nameof(self.Client.Player.IsReady));
        self.__isReadyButtonText = self.GetVariable(nameof(self.Client.Player.IsReady));

        self.UpdateButtons();
        self.SetupAddAgentSubMenu();

        self.__threadUpdateGameData = KillableThread(func = self.UpdateGameData);
        self.__threadUpdateGameData.start();
Пример #7
0
    def __init__(self, root, context):
        super().__init__(root, context)
        self.InitializeScreen()

        self.__gamesGrid = self.GetObject(
            nameof(self.Context.ServiceContext.GetGamesList))
        self.__gamesGridScrollBar = self.GetObject(\
            nameof(self.Context.ServiceContext.GetGamesList) + "Scrollbar")

        self.__gamesGrid.config(yscrollcommand=self.__gamesGridScrollBar.set)
        self.__gamesGridScrollBar.config(command=self.__gamesGrid.yview)

        self.__userName = self.GetVariable(nameof(self.Client.Name))
        self.__userName.set(self.Client.Name)

        self.__userIdentifier = self.GetVariable(nameof(
            self.Client.Identifier))
        self.__userIdentifier.set(self.Client.Identifier)

        self.__threadGetGameList = KillableThread(func=self.UpdateGamesList)
        self.__threadGetGameList.start()
Пример #8
0
    def __str__(self):
        if self.value == self._None.value:
            return str()

        elif self.value == self.AgreeWith.value:
            return nameof(self.AgreeWith)
        elif self.value == self.DisagreeWith.value:
            return nameof(self.DisagreeWith)
        elif self.value == self.AccusePlayerOfRole.value:
            return nameof(self.AccusePlayerOfRole)
        elif self.value == self.SuggestPlayerOfRole.value:
            return nameof(self.SuggestPlayerOfRole)
        elif self.value == self.DeclareSelfAsRole.value:
            return nameof(self.DeclareSelfAsRole)

        elif self.value == self.WerewolfAttack.value:
            return nameof(self.WerewolfAttack)

        elif self.value == self.SeerDivine.value:
            return nameof(self.SeerDivine)

        else:
            raise GameException("Unknown message type used.")
Пример #9
0
    def __str__(self):
        if self.value == self._None.value:
            return str()

        elif self.value == self.WaitAction.value:
            return nameof(self.WaitAction)
        elif self.value == self.SuccessfulAction.value:
            return nameof(self.SuccessfulAction)

        elif self.value == self.CannotActDuringTimeOfDay.value:
            return nameof(self.CannotActDuringTimeOfDay)
        elif self.value == self.InvalidAction.value:
            return nameof(self.InvalidAction)
        elif self.value == self.DeadPlayerTargeted.value:
            return nameof(self.DeadPlayerTargeted)
        elif self.value == self.WerewolfCannibalism.value:
            return nameof(self.WerewolfCannibalism)

        else:
            raise GameException("Unknown vote result type used.")
Пример #10
0
    def __str__(self):
        if self.value == self._None.value:
            return str()

        elif self.value == self.Connect.value:
            return nameof(self.Connect)

        elif self.value == self.GetGamesList.value:
            return nameof(self.GetGamesList)
        elif self.value == self.CreateGame.value:
            return nameof(self.CreateGame)
        elif self.value == self.JoinGame.value:
            return nameof(self.JoinGame)
        elif self.value == self.LeaveGame.value:
            return nameof(self.LeaveGame)

        elif self.value == self.GameLobby.value:
            return nameof(self.GameLobby)
        elif self.value == self.AddAgent.value:
            return nameof(self.AddAgent)
        elif self.value == self.RemoveAgent.value:
            return nameof(self.RemoveAgent)

        elif self.value == self.VoteStart.value:
            return nameof(self.VoteStart)
        elif self.value == self.VotePlayer.value:
            return nameof(self.VotePlayer)
        elif self.value == self.Talk.value:
            return nameof(self.Talk)
        elif self.value == self.Whisper.value:
            return nameof(self.Whisper)
        elif self.value == self.AttackPlayer.value:
            return nameof(self.AttackPlayer)
        elif self.value == self.DivinePlayer.value:
            return nameof(self.DivinePlayer)
        elif self.value == self.GuardPlayer.value:
            return nameof(self.GuardPlayer)
        else:
            raise GameException("Unknown packet type used.")