package uk.co.rossbinden.transferencevoid.system

import com.badlogic.ashley.core.Entity
import com.badlogic.ashley.systems.IteratingSystem
import uk.co.rossbinden.transferencevoid.component.DATA
import uk.co.rossbinden.transferencevoid.component.TERMINAL_FAMILY
import uk.co.rossbinden.transferencevoid.component.TIMER

class TerminalDataSystem: IteratingSystem(TERMINAL_FAMILY, -1) {
    override fun processEntity(entity: Entity, deltaTime: Float) {
        if (TIMER.get(entity).timeRemaining <= 0) {
            DATA.get(entity).data = 1
            TIMER.get(entity).timeRemaining = 2f
        }
    }
}