from task import Task

class TaskMap(object):
    def __init__(self):
        self.tasks = []

    def addTask(self, task):
        self.tasks.append(task)

    def getTasks(self):
        return self.tasks

    def printTasks(self):
        for task in self.tasks:
            print(task)

if __name__ == "__main__":
    taskmap = TaskMap()
    print("Welcome to TaskMap 0.4.0")
    command = "taskmap->"
    cmd = input(command)
    while cmd != "exit":
        if cmd == "add":
            desc = input()
            obj = Task(desc)
            taskmap.addTask(obj)
        elif cmd == "get":
            taskmap.printTasks()
        else:
            print("valid commands are 'add', 'get', and 'exit'.")
        cmd = input(command)
    if len(taskmap.getTasks()):
        print("These tasks were added and then forgotten: ")
        taskmap.printTasks()
    print("Thank you for using TaskMap 0.4.0!")
