// Path: main/java/com/biscuit/ColorCodes.java
// public class ColorCodes {
// 
// 	// with normal background
// 	public static final String RESET = "\u001B[0m";
// 	public static final String BLACK = "\u001B[30;1m";
// 	public static final String RED = "\u001B[31;1m";
// 	public static final String GREEN = "\u001B[32;1m";
// 	public static final String YELLOW = "\u001B[33;1m";
// 	public static final String BLUE = "\u001B[34;1m";
// 	public static final String PURPLE = "\u001B[35;1m";
// 	public static final String CYAN = "\u001B[36;1m";
// 	public static final String WHITE = "\u001B[37;1m";
// 
// 	// with black background
// 	public static final String B_RESET = "\u001B[0m";
// 	public static final String B_BLACK = "\u001B[30;40;1m";
// 	public static final String B_RED = "\u001B[31;40;1m";
// 	public static final String B_GREEN = "\u001B[32;40;1m";
// 	public static final String B_YELLOW = "\u001B[33;40;1m";
// 	public static final String B_BLUE = "\u001B[34;40;1m";
// 	public static final String B_PURPLE = "\u001B[35;40;1m";
// 	public static final String B_CYAN = "\u001B[36;40;1m";
// 	public static final String B_WHITE = "\u001B[37;40;1m";
// 
// }
// 
// Path: main/java/com/biscuit/commands/Command.java
// public interface Command {
// 
// 	boolean execute() throws IOException;
// }
// 
// Path: main/java/com/biscuit/models/Task.java
// public class Task {
// 
// 	public transient Project project;
// 
// 	public String title;
// 	public String description;
// 	public Status state;
// 	public Date initiatedDate = null;
// 	public Date plannedDate = null;
// 	public Date dueDate = null;
// 	public float estimatedTime;
// 
// 	public static String[] fields;
// 
// 	List<Bug> bugs;
// 	List<Test> tests;
// 
// 	static {
// 		fields = new String[8];
// 		fields[0] = "title";
// 		fields[1] = "description";
// 		fields[2] = "state";
// 		fields[3] = "initiated_date";
// 		fields[4] = "planned_date";
// 		fields[5] = "due_date";
// 		fields[6] = "estimated_time";
// 	}
// 
// 
// 	public void save() {
// 		project.save();
// 	}
// }
// 
// Path: main/java/com/biscuit/models/enums/Status.java
// public enum Status {
// 
// 	CREATED(0), OPEN(1), PLANNED(2), UNPLANNED(3), IN_PROGRESS(4), IN_TESTING(5), DONE(6), OVERDUE(7), REMOVED(8);
// 
// 	private final int value;
// 	public static List<String> values = new ArrayList<>(
// 			Arrays.asList("created", "open", "planned", "unplanned", "in_progress", "in_testing", "done", "overdue", "removed"));
// 
// 
// 	private Status(int value) {
// 		this.value = value;
// 	}
// 
// 
// 	public int getValue() {
// 		return value;
// 	}
// 
// 
// 	public static String allStatus() {
// 		StringBuilder sb = new StringBuilder();
// 
// 		for (String s : values) {
// 			sb.append(s).append(", ");
// 		}
// 
// 		return sb.substring(0, sb.length() - 2);
// 	}
// 
// }


import java.io.IOException;
import com.biscuit.ColorCodes;
import com.biscuit.commands.Command;
import com.biscuit.models.Task;
import com.biscuit.models.enums.Status;
package com.biscuit.commands.task;



public class ChangeStatusTask implements Command {

	Task t = null;
	Status state = null;


	public ChangeStatusTask(Task t, Status state) {
		super();
		this.t = t;
		this.state = state;
	}


	@Override
	public boolean execute() throws IOException {

		Status oldState = t.state;

		t.state = state;

// Path: main/java/com/biscuit/ColorCodes.java
// public class ColorCodes {
// 
// 	// with normal background
// 	public static final String RESET = "\u001B[0m";
// 	public static final String BLACK = "\u001B[30;1m";
// 	public static final String RED = "\u001B[31;1m";
// 	public static final String GREEN = "\u001B[32;1m";
// 	public static final String YELLOW = "\u001B[33;1m";
// 	public static final String BLUE = "\u001B[34;1m";
// 	public static final String PURPLE = "\u001B[35;1m";
// 	public static final String CYAN = "\u001B[36;1m";
// 	public static final String WHITE = "\u001B[37;1m";
// 
// 	// with black background
// 	public static final String B_RESET = "\u001B[0m";
// 	public static final String B_BLACK = "\u001B[30;40;1m";
// 	public static final String B_RED = "\u001B[31;40;1m";
// 	public static final String B_GREEN = "\u001B[32;40;1m";
// 	public static final String B_YELLOW = "\u001B[33;40;1m";
// 	public static final String B_BLUE = "\u001B[34;40;1m";
// 	public static final String B_PURPLE = "\u001B[35;40;1m";
// 	public static final String B_CYAN = "\u001B[36;40;1m";
// 	public static final String B_WHITE = "\u001B[37;40;1m";
// 
// }
// 
// Path: main/java/com/biscuit/commands/Command.java
// public interface Command {
// 
// 	boolean execute() throws IOException;
// }
// 
// Path: main/java/com/biscuit/models/Task.java
// public class Task {
// 
// 	public transient Project project;
// 
// 	public String title;
// 	public String description;
// 	public Status state;
// 	public Date initiatedDate = null;
// 	public Date plannedDate = null;
// 	public Date dueDate = null;
// 	public float estimatedTime;
// 
// 	public static String[] fields;
// 
// 	List<Bug> bugs;
// 	List<Test> tests;
// 
// 	static {
// 		fields = new String[8];
// 		fields[0] = "title";
// 		fields[1] = "description";
// 		fields[2] = "state";
// 		fields[3] = "initiated_date";
// 		fields[4] = "planned_date";
// 		fields[5] = "due_date";
// 		fields[6] = "estimated_time";
// 	}
// 
// 
// 	public void save() {
// 		project.save();
// 	}
// }
// 
// Path: main/java/com/biscuit/models/enums/Status.java
// public enum Status {
// 
// 	CREATED(0), OPEN(1), PLANNED(2), UNPLANNED(3), IN_PROGRESS(4), IN_TESTING(5), DONE(6), OVERDUE(7), REMOVED(8);
// 
// 	private final int value;
// 	public static List<String> values = new ArrayList<>(
// 			Arrays.asList("created", "open", "planned", "unplanned", "in_progress", "in_testing", "done", "overdue", "removed"));
// 
// 
// 	private Status(int value) {
// 		this.value = value;
// 	}
// 
// 
// 	public int getValue() {
// 		return value;
// 	}
// 
// 
// 	public static String allStatus() {
// 		StringBuilder sb = new StringBuilder();
// 
// 		for (String s : values) {
// 			sb.append(s).append(", ");
// 		}
// 
// 		return sb.substring(0, sb.length() - 2);
// 	}
// 
// }


// Path: main/java/com/biscuit/commands/task/ChangeStatusTask.java
import java.io.IOException;
import com.biscuit.ColorCodes;
import com.biscuit.commands.Command;
import com.biscuit.models.Task;
import com.biscuit.models.enums.Status;

package com.biscuit.commands.task;



public class ChangeStatusTask implements Command {

	Task t = null;
	Status state = null;


	public ChangeStatusTask(Task t, Status state) {
		super();
		this.t = t;
		this.state = state;
	}


	@Override
	public boolean execute() throws IOException {

		Status oldState = t.state;

		t.state = state;

		t.save();