示例#1
0
 public bool EndGame()
 {
     if (!GameStarted)
     {
         return(false);
     }
     TableGame   = null;
     GameStarted = false;
     return(true);
 }
示例#2
0
 public WebTable(int idAdmin, string pass, string Name)
 {
     this.Name    = Name;
     this.IdAdmin = idAdmin;
     Players      = new HashSet <int>();
     Seats        = new List <int>();
     SeatCount    = 3;
     Players.Add(idAdmin);
     Seats[0]        = idAdmin;
     GameStarted     = false;
     TableGame       = null;
     CurrentGameType = Hanabi.GameType.FiveColor;
     Password        = pass;
 }
示例#3
0
        public bool StartGame()
        {
            if (GameStarted)
            {
                return(false);
            }
            var isGood = true;

            for (int i = 0; i < SeatCount; i++)
            {
                isGood = isGood && Seats[i] != -1;
            }
            isGood = isGood && Players.Count == SeatCount;
            if (!isGood)
            {
                return(false);
            }
            GameStarted = true;
            TableGame   = new Hanabi.Game(CurrentGameType, Players.Count);
            return(true);
        }