30 lines
745 B
C#
30 lines
745 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace YachtDice.Scoring
|
|
{
|
|
[Serializable]
|
|
public struct ScoreResult
|
|
{
|
|
public int BaseScore;
|
|
public int FlatBonus;
|
|
public float Multiplier;
|
|
public int[] DiceValues;
|
|
public YachtCategory Category;
|
|
|
|
public int FinalScore => Mathf.FloorToInt((BaseScore + FlatBonus) * Multiplier);
|
|
|
|
public static ScoreResult Create(int baseScore, int[] diceValues, YachtCategory category)
|
|
{
|
|
return new ScoreResult
|
|
{
|
|
BaseScore = baseScore,
|
|
FlatBonus = 0,
|
|
Multiplier = 1f,
|
|
DiceValues = diceValues,
|
|
Category = category
|
|
};
|
|
}
|
|
}
|
|
}
|