class_name trassa_unit extends Node

const ONLINE_TIMEOUT: = 5000

class Trassa extends unit.Unit:
    var source_addr: = []
    func process(tick: int):
        if (tick - rx_tick) > ONLINE_TIMEOUT:
            if online:
                online = false
                emit_signal('line_changed', self)
        return Error.ERR_BUSY

    func _init(unit_name: StringName):
        self.name = unit_name

    func parse(data: PackedByteArray, tick: int):
        rx_tick = tick
        if not online:
            online = true
            emit_signal('line_changed', self)
