-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] : Data design for state
s, format
s and event
s of sports.
#25
Comments
Match Stateconst matchState = {
matchNumber: 5,
totalMatches: 6,
pointsToWin: 11,
currentBallHolder: "playerX",
first: {
playingTeam: "CSE",
totalPoints: 10,
totalMatchWon: 2,
playerNo: 2,
players: {
player: {
name: "PlayerA",
points: 34,
},
order: [
{
name: "PlayerX",
points: 0,
status: "played",
profileLink: "https://example.com/profile/playerx",
},
{
name: "PlayerY",
points: 10,
status: "playing",
profileLink: "https://example.com/profile/playery",
},
{
name: "PlayerZ",
points: 0,
status: "nextToPlay",
profileLink: "https://example.com/profile/playerz",
}
]
},
inningsStatus: "in_progress",
foulsStatus: null,
target: null
},
second: {
playingTeam: "IT",
totalPoints: 10,
totalMatchWon: 2,
playerNo: 2,
players: {
player: {
name: "PlayerA",
points: 34,
},
order: [
{
name: "PlayerX",
points: 0,
status: "played",
profileLink: "https://example.com/profile/playerx",
},
{
name: "PlayerY",
points: 10,
status: "playing",
profileLink: "https://example.com/profile/playery",
},
{
name: "PlayerZ",
points: 0,
status: "nextToPlay",
profileLink: "https://example.com/profile/playerz",
}
]
},
foulsStatus: null,
target: 10
},
interrupted: "match_delay",
teamACaptain: "CaptainA",
teamBCaptain: "CaptainB",
umpires: ["Umpire1", "Umpire2"],
matchStatus: "in_progress", // Possible values: draw/cancelled
matchOutcome: [
null, // Possible values: EEE/IT/draw/no_result
]
}; |
const event25 = {
type: "fault",
details: {
player: "PlayerB",
faultType: "service_fault", // "service_fault", "net_touch", "out_of_bounds"
},
timestamp: new Date()
}; Match Event for badminton. |
Match Eventconst event24 = {
type: "points_scored",
details: {
points: 1,
currentBallHolder:"player2",
scoringType: "hit", // Possible values: miss, hit, foul
illegal: "foul", // Indicates foul play
penalty: 1, // 0 for legal play
},
timestamp: new Date()
};
const event = {
type: "match_won",
details: {
team_1_score: 11,
team_2_score: 5,
match_result: "Team_1_won" // Possible values: team1, team2, draw
},
timestamp: new Date()
}; |
const matchFormat = {
totalGames: 3,
pointsPerGame: 21, // Each game is played upto 21 points
pointsToWin: 2,
penaltyActions: {
fault: () => ({
illegal: "fault",
penalty: 1
}),
misconduct: () => ({
illegal: "misconduct",
penalty: 1
})
},
extrasActions: {
let: () => ({
type: "let",
description: "Let: The rally is replayed"
}),
serviceOver: () => ({
type: "service_over",
description: "Service Over: The serve changes to the opponent"
})
},
} match Format for badminton |
const matchState = {
game: {
currentGame: 1, // Current game number
totalGames: 3, // Best of 3 games
score: {
playerA: 15, // Score of Player A
playerB: 18 // Score of Player B
},
server: "playerA", // Current server
receiver: "playerB", // Current receiver
rallies: [
{
rallyNumber: 1,
winner: "playerA",
description: "Player A won the rally with a smash"
},
{
rallyNumber: 2,
winner: "playerB",
description: "Player B won the rally with a drop shot"
}
]
},
players: {
playerA: {
name: "Player A",
gamesWon: 0, // Number of games won by Player A
profileLink: "https://example.com/profile/playerA"
},
playerB: {
name: "Player B",
gamesWon: 1, // Number of games won by Player B
profileLink: "https://example.com/profile/playerB"
}
}
}
match state badminton |
Match Format for Cricket keeping in mind all the Edge Cases: const matchFormat = {
totalOvers: 20,
powerplayOvers: 6,
legalDeliveriesPerOver: 6,
maxOversPerBowler: (totalOvers) => Math.ceil(totalOvers / 5),
penaltyActions: {
noBall: () => ({
illegal: "no_ball",
freeHit: true,
penalty: 1,
additionalPenalty: "runs scored on free-hit count only."
}),
wide: () => ({
illegal: "wide",
freeHit: false,
penalty: 1,
description: "Delivery counts as an extra ball and 1 penalty run added."
}),
timeViolation: (team) => ({
violation: "time_penalty",
penalty: team === "batting"
? "deduction from total runs"
: "extra runs awarded to opposition",
value: 5
}),
},
extrasActions: {
byes: (runs) => ({
type: "byes",
penalty: runs,
description: `Byes: ${runs} run(s) awarded for non-intercepted deliveries.`
}),
legByes: (runs) => ({
type: "leg_byes",
penalty: runs,
description: `Leg byes: ${runs} run(s) awarded for deflected non-contact deliveries.`
}),
overthrow: (runs) => ({
type: "overthrow",
bonusRuns: runs,
description: `Overthrow: ${runs} bonus run(s) due to fielding error.`
}),
},
weatherInterruption: {
reducedOvers: (remainingOvers) => ({
situation: "rain_interruption",
newTotalOvers: remainingOvers,
rulesApplied: "Duckworth-Lewis-Stern method or other DLS variation."
}),
abandonedMatch: () => ({
outcome: "abandoned",
result: "No result or reserve day applied."
})
},
applyPowerPlayRestrictions: (overs) => {
return overs <= matchFormat.powerplayOvers
? "Only two fielders outside the 30-yard circle during powerplay."
: "Normal fielding restrictions apply after powerplay.";
},
tieBreaker: {
superOver: () => ({
rule: "Super Over",
maxBalls: 6,
maxBatters: 3,
description: "In case of a tie, teams play one over each to determine the winner."
}),
boundaryCount: (team1Boundaries, team2Boundaries) => ({
rule: "Boundary Count",
result: team1Boundaries > team2Boundaries
? "Team 1 wins by boundary count"
: "Team 2 wins by boundary count."
})
},
playerSubstitution: {
concussionSubstitution: (player) => ({
allowed: true,
description: `${player} can be replaced .`
}),
},
fieldingRestrictions: {
numberOfFieldersOutsideCircle: (overs) => {
if (overs <= matchFormat.powerplayOvers) return 2;
else if (overs > matchFormat.powerplayOvers && overs <= matchFormat.totalOvers - 5) return 4;
return 5; // Death overs
},
penaltyForViolation: () => ({
description: "5 penalty runs for fielding restrictions violations.",
action: "Ball counted as a no-ball."
})
},
reviewSystem: {
drs: true,
maxReviewsPerInnings: 2,
description: "Teams can use Decision Review System (DRS) up to 2 unsuccessful attempts per innings."
},
overRatePenalty: (ratePerHour) => {
if (ratePerHour < 10) {
return {
penalty: "Slow over rate penalty",
deduction: "One fielder outside 30-yard circle for remaining overs.",
};
}
return {
status: "Compliant",
message: "No penalty applied."
};
}
};
|
majorbruteforce
changed the title
[ Discussion ] : Data design for
[Discussion] : Data design for Dec 30, 2024
state
s, format
s and event
s of sports.state
s, format
s and event
s of sports.
Here's matchFormat, matchState and matchEvent for carrom
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: