func (r *Runner) validateCreateGame(m message.Message) error {
	switch {
	case len(r.games) >= r.MaxGames:
		return fmt.Errorf("the maximum number of games have already been created (%v)", r.MaxGames)
	case m.Game == nil, m.Game.Board == nil:
		return fmt.Errorf("board config required when creating game")
	case m.Game.Config == nil:
		return fmt.Errorf("missing config for game properties")
	}
	return nil
}
// validateCreateGame returns an err if the runner cannot create a new game or the message to create one is invalid.
validateCreateGame returns an err if the runner cannot create a new game or the message to create one is invalid.
// validateCreateGame returns an err if the runner cannot create a new game or the message to create one is invalid .
func (r *Runner) validateCreateGame(m message.Message) error {
	switch {
	case len(r.games) >= r.MaxGames:
		return fmt.Errorf("the maximum number of games have already been created (%v)", r.MaxGames)
	case m.Game == nil, m.Game.Board == nil:
		return fmt.Errorf("board config required when creating game")
	case m.Game.Config == nil:
		return fmt.Errorf("missing config for game properties")
	}
	return nil
}
func ( r * Runner ) validateCreateGame ( m message . Message ) error { switch { case len ( r . games ) >= r . MaxGames : return fmt . Errorf ( " " , r . MaxGames ) case m . Game == nil , m . Game . Board == nil : return fmt . Errorf ( " " ) case m . Game . Config == nil : return fmt . Errorf ( " " ) } return nil }
validateCreateGame returns an err if the runner cannot create a new game or the message to create one is invalid.
validateCreateGame returns an err if the runner cannot create a new game or the message to create one is invalid .