Skip to content

Commit

Permalink
small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-flynn committed Sep 25, 2024
1 parent 7fed43d commit c53c7ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions front-end/src/seasons/fgc-2024/referee/HRExtra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ const HeadRefereeExtra: React.FC = () => {
};

const handleFoodSecuredDecrement = () => {
handleMatchDetailsUpdate('foodSecured', -1);
handleMatchDetailsAdjustment('foodSecured', -1);
};

const handleFoodSecuredIncrement = () => {
handleMatchDetailsUpdate('foodSecured', 1);
handleMatchDetailsAdjustment('foodSecured', 1);
};

return (
Expand Down
21 changes: 12 additions & 9 deletions lib/models/src/seasons/FeedingTheFuture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,24 @@ export function calculateScore(match: Match<MatchDetails>): [number, number] {
const [redFoodProduced, blueFoodProduced] = getFoodProducedPoints(details);
const foodSecuredPoints = getFoodSecuredPoints(details);
const coopertitionPoints = getCoopertitionPoints(details);
const redScore =
const redEnergyPoints = Math.round(
(redResevoirPoints + redNexusPoints + redFoodProduced) *
ScoreTable.BalanceMultiplier(nBalanced) +
foodSecuredPoints +
coopertitionPoints;
const blueScore =
ScoreTable.BalanceMultiplier(nBalanced)
);
const redScore = redEnergyPoints + foodSecuredPoints + coopertitionPoints;
const blueEnergyPoints = Math.round(
(blueResevoirPoints + blueNexusPoints + blueFoodProduced) *
ScoreTable.BalanceMultiplier(nBalanced) +
foodSecuredPoints +
coopertitionPoints;
ScoreTable.BalanceMultiplier(nBalanced)
);
const blueScore = blueEnergyPoints + foodSecuredPoints + coopertitionPoints;
const redPenalty = Math.round(match.redMinPen * ScoreTable.Foul * redScore);
const bluePenalty = Math.round(
match.blueMinPen * ScoreTable.Foul * blueScore
);
return [redScore + bluePenalty, blueScore + redPenalty];
return [
Math.round(redScore + bluePenalty),
Math.round(blueScore + redPenalty)
];
}

export function getResevoirPoints(details: MatchDetails): [number, number] {
Expand Down

0 comments on commit c53c7ce

Please sign in to comment.