feat(guides): add structured image-first editor
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export function calculateTeamMetrics(damage: number[], rotationSeconds: number) {
|
||||
const totalDamage = damage.reduce((sum, value) => sum + value, 0);
|
||||
if (!Number.isFinite(rotationSeconds) || rotationSeconds <= 0 || damage.some((value) => !Number.isFinite(value) || value < 0) || totalDamage <= 0) {
|
||||
throw new Error("Team damage and rotation must be positive finite values.");
|
||||
}
|
||||
return {
|
||||
totalDamage,
|
||||
totalDps: totalDamage / rotationSeconds,
|
||||
shares: damage.map((value) => value / totalDamage * 100),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user