---
# System prepended metadata

title: Final Countdown

---

# Final Countdown

## A working game

Need a
```java=
setOnObjectDestroyed(GameObject objet)
```


### Features Needed:


public void movePlayer() {
    player.setMode("running")
}

- Scores. "Coins"

- Animation: Let's not worry

- 

**Systems Required**

- Health System

- ScoreSystem





```java=
public class UISystem implements ObservableStatistics {
    Map<String, Supplier<UIElement>> callbacks;
    
    
    public void registerUICallbacks();
    
    public void update() {
        String currPlayerHealth = callback.get("playerHealth").get();
        consumer.accept(currPlayerHealth);
    }
     
    
    
    
}

public class HealthSystem {
    private HealthComponent mainPlayerHealth
    
    public HealthSystem() {
        registerStatistic("playerHealth", this::getMainHealth)
    }
    
    private String getMainHealth() {
        return mainPlayer.health;
    }
}
```
```java=
public class BaseClass {
MultiMap<String, Supplier<String>>
 
```

```java=
public class StatisticManager implements ObservableStatistics {
    MultiMap<String, Supplier<String>> callbacks;
    MultiMap<String, Consumer<String>> viewCallbacks;
    
    public void setOnStatisticUpdate(String statistic, Consumer<String> consumer) {
        viewCallbacks.put(statistic, consumer);
     
    
    public void update() {
        viewCallbacks.forEach( (key, value) -> {
        
          
    }
    
    public List<String> getTrackableStatistics() {
        return callbacks.keys();
    }
    
    
    
}

{
    "view": {
        "statistics": [
        {
            name: "playerHealth",
        }
        ]
    }
}

public class HealthSystem {
    Map<String, Consumer<UIElement>> callbacks;
    enum STATISTIC {
        HEALTH_UPDATE, STOP_DOING_DRUGS, SMOKING_IS_BAD
    }
    
    private HealthComponent mainPlayerHealth;
    
    public HealthSystem() {
        registerInfo("playerHealth", this::getMainHealth)
    }
    
    public void registerViewCallback(STATISTIC thing, Consumer<> consumer) {
    
    }
    
    public void update() {
        // update health
        callbacks.get("playerHealth").accept(...);
    }
    
}
```