All pastes #263697 Raw Edit

aLFie

public text v1 · immutable
·published 2006-12-01 19:06 UTC
rendered paste body
            int i = 0;
            int pSeat = 0;
            rx = new Regex(__stacks);
            mc = rx.Matches(history);
            foreach (Match mtch in mc)
            {
                players.Add(i, new Dictionary<string, string>());
                players[i].Add("PlayerSeatNumber", mtch.Groups[1].ToString());
                players[i].Add("PlayerName", mtch.Groups[2].ToString());
                players[i].Add("PlayerStack", mtch.Groups[3].ToString());
                pSeat = Convert.ToInt16(players[i]["PlayerSeatNumber"].ToString());
                if (pSeat == ButtonSeat)
                {
                    players[i].Add("PlayerSeatTitle", __buttontitle);
                }
                i++;
            }

            // benennt die restlichen positionen
            i = 0;
            pSeat = 0;
            int x = ButtonSeat + 1;
            bool pSeated = false;
            while (seats.Count > 0)
            {
                pSeat = Convert.ToInt16(players[i]["PlayerSeatNumber"].ToString());
                pSeated = players[i].ContainsKey("PlayerSeatTitle");
                if ((pSeat == x) && (pSeat != ButtonSeat) && !pSeated)
                {
                    players[i].Add("PlayerSeatTitle", seats.Pop().ToString());
                    i = 0;
                    if (x < 10)
                        x++;
                    else
                        x = 1;
                }
                else 
                {
                    if (i < (TotalPlayers-1))
                        i++;
                    else
                        i = 0;
                }
            }