Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Micro-rollup for Unification Cup

NotificationsYou must be signed in to change notification settings

stackrlabs/unification-cup

Repository files navigation

banner

Unification Cup

Micro-rollup forAvail's Unification Cup 2024

State Structure

typeLeagueState={admins:string[];meta:{// metadata about the tournamentround:number;startTime:number;endTime:number;winnerTeamId:number;byes:{teamId:number;round:number;}[];};teams:{id:number;name:string;}[];matches:{id:number;scores:Record<string,number>;startTime:number;endTime:number;penaltyStartTime:number;winnerTeamId:number;}[];players:{id:number;name:string;teamId:number;removedAt?:number;}[];logs:{// logs of all the actions performed in the tournamentplayerId:number;matchId?:number;timestamp:number;action:string;}[];};

Transition Functions

  • startTournament: Start the tournament
  • startMatch: Start a match withmatchId
  • penaltyShootout: Start a penalty shootout for a match withmatchId
  • endMatch: End a match withmatchId
  • logGoal: Log a goal for a player withplayerId in a match withmatchId
  • logBlock: Log a block for a player withplayerId in a match withmatchId
  • logFoul: Log a foul for a player withplayerId in a match withmatchId
  • logPenaltyHit: Log a penalty hit for a player withplayerId in a match withmatchId
  • logPenaltyMiss: Log a penalty miss for a player withplayerId in a match withmatchId
  • addPlayer: Add a player withplayerId to a team withteamId
  • removePlayer: Remove a player withplayerId from a team withteamId
  • logByes: Log a bye for a team withteamId. (Used in case of odd number of teams)
  • removeGoal: Remove a goal for a player withplayerId in a match withmatchId

How to run?

Run using Node.js 🚀

npm start

Run using Docker 🐳

  • Build the image using the following command: (make sure you replace `<NPM_TOKEN>` with the actual value)
# For Linuxdocker build -t unification-league:latest. --build-arg NPM_TOKEN=<NPM_TOKEN># For Mac with Apple Silicon chipsdocker buildx build --platform linux/amd64,linux/arm64 -t unification-league:latest. --build-arg NPM_TOKEN=<NPM_TOKEN>
  • Run the Docker container using the following command:
# If using SQLite as the datastoredocker run -v ./db.sqlite:/app/db.sqlite -p<HOST_PORT>:<CONTAINER_PORT> --name=unification-league -it unification-league:latest# If using other URI based datastoresdocker run -p<HOST_PORT>:<CONTAINER_PORT> --name=unification-league -it unification-league:latest

About

Micro-rollup for Unification Cup

Resources

Stars

Watchers

Forks

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp