/// <summary> /// Checks if the game can start, in which case notifies /// the game controller. /// </summary> protected virtual void OnGameCanStart() { if (this.GameCanStart != null) { IList<string> playerIds = this.Players.Select(player => player.Id).ToList(); var args = new TableCanStartEventArgs(playerIds); this.GameCanStart(this, args); } }
private void OnGameCanStart(object sender, TableCanStartEventArgs tableCanStartEventArgs) { this.OnGameCanStartWasInvoked = true; }
/// <summary> /// Notifies the given players that the game can start /// </summary> /// <param name="sender"></param> /// <param name="tableCanStartEventArgs"></param> private void GameCanStart(object sender, TableCanStartEventArgs tableCanStartEventArgs) { // notify all the players tableCanStartEventArgs.PlayersToBeNotified .ToList() .ForEach(x => this._notifier.NotifyClientThatGameCanStart(x)); }