SiteBoardgameController

struct SiteBoardgameController : SiteControllerUtils

Pages for displaying board games in the onboard Board Game Library.

  • Declaration

    Swift

    func registerRoutes(_ app: Application) throws
  • gamesPageHandler(_:) Asynchronous

    GET /boardgames

    Returns a list of boardgames matching the query. Pageable.

    Query Parameters:

    • search=STRING Filter only games whose title that match the given string.
    • favorite=TRUE Filter only favorites
    • start=INT
    • limit=INT

    Declaration

    Swift

    func gamesPageHandler(_ req: Request) async throws -> View
  • GET /boardgames/:boardgameID/expansions

    Declaration

    Swift

    func expansionPageHandler(_ req: Request) async throws -> View
  • createFezForGame(_:) Asynchronous

    GET /boardgames/:boardgameID/createfez

    Opens the Create Fez page, prefilled with info aboutt he given board game.

    Declaration

    Swift

    func createFezForGame(_ req: Request) async throws -> View
  • GET /boardgames/guide

    Finds boardgames that match a set of user’s criteria. Uses a scoring system to find games that best match the criteria given in the URL query. With no query, just shows the input form.

    To avoid confusion: The API has both maxAge and minAge parameters. The URL query in the UI only has maxage, but considers the value 14 to actually be a minAge parameter.

    Query Parameters:

    • numplayers=INT The desired number of players. Filters for games that allow this # of players, and sorts for recommendedPlayers close to this.
    • timetoplay=INT How much time you have to play. Filters for games with a avgPlayTime shorter than this, sorts for games with avgPlayTime close to this.
    • maxage=INT If nonzero, filters out games with a minAge greater than this value. Special Case: The value 14 filters out games with minAge less than 14.
    • complexity=INT If nonzero, sorts for games with near this complexity value.

    Declaration

    Swift

    func boardgameGuideHandler(_ req: Request) async throws -> View
  • addFavoriteGame(_:) Asynchronous

    GET /boardgame/:boardgameID/favorite

    Declaration

    Swift

    func addFavoriteGame(_ req: Request) async throws -> HTTPStatus
  • removeFavoriteGame(_:) Asynchronous

    DELETE /boardgame/:boardgameID/favorite

    Declaration

    Swift

    func removeFavoriteGame(_ req: Request) async throws -> HTTPStatus