package Error;

import Hardware.HD;
import Hardware.RAM;
import toolBox.Print;

public class ErrorTypes{
	
	public boolean NO_MEMORY_FOR_SOFTWARE = false;
	public boolean NO_RAM_FOR_TASK = false;
	
	public static boolean NO_MEMORY_FOR_SOFTWARE(HD hd, int minSpace){
		if(hd.getTotalSpace() - hd.getUsedSpase() < minSpace) {
			Print.info("---------------------------------------------------");
			Print.info("ERROR Type:  NO_MEMORY_FOR_SOFTWARE");
			Print.info("ERROR Info:  Total  space: " + hd.getTotalSpace() + "MB");
			Print.info("             Used   space: " + hd.getUsedSpase() + "MB");
			Print.info("             Needed space: " + minSpace);
			Print.info("---------------------------------------------------");
			Print.info("Error happendes when the computer doesn't have");
			Print.info("enoght Memory to download a software! Upgrade");
			Print.info(" your HD or delete unneeded softwares!");
			Print.info("---------------------------------------------------");
			return true;
		}
		return false;
	}
	
	public static boolean NO_RAM_FOR_TASK(RAM ram, int minUsage) {
		if((ram.getTotalRam() - ram.getUsedRAM()) < minUsage) {
			Print.info("---------------------------------------------------");
			Print.info("ERROR Type:  NO_RAM_FOR_TASK");
			Print.info("ERROR Info:  Total  RAM: " + ram.getTotalRam() + "MB");
			Print.info("             Used   RAM: " + ram.getUsedRAM() + "MB");
			Print.info("             Needed RAM: " + minUsage);
			Print.info("---------------------------------------------------");
			Print.info("Error happendes when the computer doesn't have");
			Print.info("enoght RAM to run an task! Upgrade your RAM or");
			Print.info("stop unused tasks to avoid getting the error! ");
			Print.info("---------------------------------------------------");
			return true;
		}
		return false;
	}
	
}

@@ -95,13 +95,8 @@
 rror
-Types
 %7B%0A%09%0A
@@ -316,662 +316,8 @@
 ) %7B%0A
-%09%09%09Print.info(%22---------------------------------------------------%22);%0A%09%09%09Print.info(%22ERROR Type:  NO_MEMORY_FOR_SOFTWARE%22);%0A%09%09%09Print.info(%22ERROR Info:  Total  space: %22 + hd.getTotalSpace() + %22MB%22);%0A%09%09%09Print.info(%22             Used   space: %22 + hd.getUsedSpase() + %22MB%22);%0A%09%09%09Print.info(%22             Needed space: %22 + minSpace);%0A%09%09%09Print.info(%22---------------------------------------------------%22);%0A%09%09%09Print.info(%22Error happendes when the computer doesn't have%22);%0A%09%09%09Print.info(%22enoght Memory to download a software! Upgrade%22);%0A%09%09%09Print.info(%22 your HD or delete unneeded softwares!%22);%0A%09%09%09Print.info(%22---------------------------------------------------%22);%0A
 %09%09%09r

Revert "Update ErrorTypes.java"