namespace ScoreboardApi
{
    using ScoreboardApi.Objects;

    public class PointsCalculator : IPointsCalculator
    {
        public int GetEventScore(EventType eventType)
        {
            switch (eventType)
            {
                case EventType.Penalty:
                    return 3;
                case EventType.Try:
                    return 5;
                case EventType.Conversion:
                    return 2;
                case EventType.DropGoal:
                    return 3;
                default:
                    return 0;
            }
        }

        public int CalculateNewScore(EventType eventType, int currentScore)
        {
            switch (eventType)
            {
                case EventType.Penalty:
                    return currentScore + GetEventScore(eventType);
                case EventType.Try:
                    return currentScore + GetEventScore(eventType);
                case EventType.Conversion:
                    return currentScore + GetEventScore(eventType);
                case EventType.DropGoal:
                    return currentScore + GetEventScore(eventType);
                default:
                    return currentScore;
            }
        }
    }
}