コード例 #1
0
        public void ChangeSpeech(AuctioneerState state, int player, string value)
        {
            this.state = state;

            switch (state)
            {
            case (AuctioneerState.FirstItem):
                sCurrent = sFirstItem + value + ".";
                break;

            case (AuctioneerState.NextItem):
                sCurrent = sNextItem + value + ".";
                break;

            case (AuctioneerState.FirstBid):
                iWinningPlayerIndex = player;
                sCurrent            = "Player " + player + sFirstBid + value + " Million!";
                timer_going         = 3;
                break;

            case (AuctioneerState.NewBid):
                iWinningPlayerIndex = player;
                sCurrent            = "Player " + player + sNewBid + value + " Million!";
                timer_going         = 3;
                break;

            case (AuctioneerState.GoingA):
                sCurrent    = sTimePass[0];
                timer_going = 3;
                break;

            case (AuctioneerState.GoingB):
                sCurrent    = sTimePass[1];
                timer_going = 3;
                break;

            case (AuctioneerState.GoingC):
                sCurrent    = sTimePass[2];
                timer_going = 3;
                break;

            case (AuctioneerState.Sold):
                timer_going = 3;
                sCurrent    = sSold + "Player " + player + "!";
                break;
            }

            rSpeechBubble.Width  = (int)font.MeasureString(sCurrent).X + 10;
            rSpeechBubble.Height = (int)font.MeasureString(sCurrent).Y + 10;
            rSpeechBubble.X      = rectangle.X + rectangle.Width - rSpeechBubble.Width;

            int x = 0;

            typedText           = "";
            typedTextLength     = 0;
            parsedText          = Tools.ParseText(font, sCurrent, rSpeechBubble, ref x);
            delayInMilliseconds = 50;
            isDoneDrawing       = false;
        }
コード例 #2
0
ファイル: Auctioneer.cs プロジェクト: NarPar/AuctionBoxing
        public void ChangeSpeech(AuctioneerState state, int player, string value)
        {
            this.state = state;

            switch (state)
            {
                case (AuctioneerState.FirstItem):
                    sCurrent = sFirstItem + value + ".";
                    break;
                case(AuctioneerState.NextItem):
                    sCurrent = sNextItem + value + ".";
                    break;
                case (AuctioneerState.FirstBid):
                    iWinningPlayerIndex = player;
                    sCurrent = "Player " + player + sFirstBid + value + " Million!";
                    timer_going = 3;
                    break;
                case (AuctioneerState.NewBid):
                    iWinningPlayerIndex = player;
                    sCurrent = "Player " + player + sNewBid + value + " Million!";
                    timer_going = 3;
                    break;
                case (AuctioneerState.GoingA):
                    sCurrent = sTimePass[0];
                    timer_going = 3;
                    break;
                case (AuctioneerState.GoingB):
                    sCurrent = sTimePass[1];
                    timer_going = 3;
                    break;
                case (AuctioneerState.GoingC):
                    sCurrent = sTimePass[2];
                    timer_going = 3;
                    break;
                case (AuctioneerState.Sold):
                    timer_going = 3;
                    sCurrent = sSold + "Player " + player + "!";
                    break;

            }

            rSpeechBubble.Width = (int)font.MeasureString(sCurrent).X + 10;
            rSpeechBubble.Height = (int)font.MeasureString(sCurrent).Y + 10;
            rSpeechBubble.X = rectangle.X + rectangle.Width - rSpeechBubble.Width;

            int x = 0;
            typedText = "";
            typedTextLength = 0;
            parsedText = Tools.ParseText(font, sCurrent, rSpeechBubble, ref x);
            delayInMilliseconds = 50;
            isDoneDrawing = false;
        }