package com.duolebo.blyrobot.tools

import com.duolebo.blyrobot.data.Task
import kotlin.collections.ArrayList

class TaskManager {
    private val tasks = ArrayList<Task>()

    fun add(task: Task) {
        this.tasks.add(task)
    }

    fun remove(task: Task) {
        val item = tasks.find {
            it.packageName == task.packageName
        }

        item?.run {
            tasks.remove(this)
        }
    }

    fun isExist(task: Task): Boolean {
        val item = tasks.find {
            it.packageName == task.packageName
        }

        return item != null
    }

    fun start() {

    }

    fun stop() {

    }
}