public bool EndGame() { if (!GameStarted) { return(false); } TableGame = null; GameStarted = false; return(true); }
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; }
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); }