| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package de.pewpewproject.lasertag.lasertaggame.state.synced.implementation; |
||
| 13 | public class ActivationState implements IActivationState { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * HashSet containing the uuids of all and only the |
||
| 17 | * activated players. |
||
| 18 | */ |
||
| 19 | private final HashSet<UUID> activatedPlayersUuids = new HashSet<>(); |
||
| 20 | |||
| 21 | @Override |
||
| 22 | public synchronized boolean isActivated(UUID playerUuid) { |
||
| 23 | return activatedPlayersUuids.contains(playerUuid); |
||
| 24 | } |
||
| 25 | |||
| 26 | @Override |
||
| 27 | public synchronized void activatePlayer(UUID playerUuid) { |
||
| 28 | activatedPlayersUuids.add(playerUuid); |
||
| 29 | } |
||
| 30 | |||
| 31 | @Override |
||
| 32 | public synchronized void deactivatePlayer(UUID playerUuid) { |
||
| 33 | activatedPlayersUuids.remove(playerUuid); |
||
| 34 | } |
||
| 36 |