コード例 #1
0
        private void JoinGame(TwitchUser speaker, string additionalText)
        {
            var pointManager = controller.room.pointManager.ForUser(speaker);
            var player       = new RussianRoulettePlayer <TwitchUser>(pointManager, speaker);

            if (controller.game.Join(player))
            {
                controller.room.SendWhisper(speaker, "You're in");

                if (controller.game.isFull)
                {
                    StartGame();
                }
                else if (controller.game.isReadyToStart)
                {
                    MinHit_StartWaitingForAdditionalPlayers();
                }
            }
            else
            {
                if (controller.game.Contains(speaker))
                {
                    controller.room.SendWhisper(speaker, "You're already in.");
                }
                else
                {
                    controller.room.SendWhisper(speaker, "You can't afford to play.");
                }
            }
        }
コード例 #2
0
        public override bool Join(RussianRoulettePlayer <PlayerIdType> playerGameObject)
        {
            if (!Contains(playerGameObject))
            {
                if (base.Join(playerGameObject))
                {
                    if (playerGameObject.PlaceBet(bet, true) > 0)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }