| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package de.pewpewproject.lasertag.lasertaggame.state.server.implementation; |
||
| 15 | public class MusicalChairsState implements IMusicalChairsState { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Map mapping every player's uuid to the overall score they achieved |
||
| 19 | * key: The players uuid |
||
| 20 | * value: The overall score the player achieved |
||
| 21 | */ |
||
| 22 | private final Map<UUID, Long> playerOverallScoreMap = new ConcurrentHashMap<>(); |
||
| 23 | |||
| 24 | @Override |
||
| 25 | public void setPlayerOverallScore(UUID playerUuid, long newScore) { |
||
| 26 | playerOverallScoreMap.put(playerUuid, newScore); |
||
| 27 | } |
||
| 28 | |||
| 29 | @Override |
||
| 30 | public long getPlayerOverallScore(UUID playerUuid) { |
||
| 31 | return Optional.ofNullable(playerOverallScoreMap.get(playerUuid)).orElse(0L); |
||
| 32 | } |
||
| 33 | |||
| 34 | @Override |
||
| 35 | public void reset() { |
||
| 36 | |||
| 37 | playerOverallScoreMap.clear(); |
||
| 38 | } |
||
| 40 |