package design.model.statistics; import java.util.Arrays; import design.model.Round; public abstract class StatisticsDecorator implements Statistics{ protected Statistics wrapped_statistics; public StatisticsDecorator(Statistics wrapped_statistics){ this.wrapped_statistics = wrapped_statistics; } @Override public Round[] getRounds() { return wrapped_statistics.getRounds(); } @Override public int get_score() { return Arrays.stream(getRounds()).mapToInt(Round::getTotalSwings).sum(); } @Override public double get_distance() { return Arrays.stream(getRounds()).mapToDouble(Round::getTotalDistance).sum(); } }