//*************************END ADD PROTOCOL METHOD************************// //*************************ADD UTILITY METHOD*****************************// public void AddUtility() { DroidOptions("Utility"); //ADD NEW UTILITY TO DROID COLLECTION AND DISPLAY CONFIRMATION Console.WriteLine(); Droid newUtility = new Utility(materailSelectionString, "Utility", colorSelectionString, toolBox, computerConnection, arm); droidCollection.AddNewDroid(newUtility); newUtility.CalculateBaseCost(); newUtility.CalculateTotalCost(); totalCost += newUtility.totalCost; Console.WriteLine(newUtility + Environment.NewLine + Environment.NewLine + "Droid has been successfully added to collection.\n"); }
//**********************END ADD ASTROMECH METHOD********************// ////*********************METHOD TO ADD HARD-CODED DUMMY DATA TO DROID COLLECTION***********************// public void AddDummyData() { Random random = new Random(); for (int i = 0; i < 20; i++) { int randomModelInt = random.Next(1, 5); int randomMaterialInt = random.Next(1, 3); int randomColorInt = random.Next(1, 3); int randomToolInt = random.Next(1, 3); int randomCompInt = random.Next(1, 3); int randomArmInt = random.Next(1, 3); int randomTrashInt = random.Next(1, 3); int randomVacInt = random.Next(1, 3); int randomFireInt = random.Next(1, 3); //Random Material Selection if (randomMaterialInt == 1) dummyMaterial = "Iron"; if (randomMaterialInt == 2) dummyMaterial = "Steel"; //Random Color Selection if (randomColorInt == 1) dummyColor = "White"; if (randomColorInt == 2) dummyColor = "Black"; //Random Toolbox Selection if (randomToolInt == 1) dummyToolBox = true; if (randomToolInt == 2) dummyToolBox = false; //Random Computer Connection Selection if (randomCompInt == 1) dummyCompConnection = true; if (randomCompInt == 2) dummyCompConnection = false; //Random Arm Selection if (randomArmInt == 1) dummyArm = true; if (randomArmInt == 2) dummyArm = false; //Random Trash Selection if (randomTrashInt == 1) dummyTrash = true; if (randomTrashInt == 2) dummyTrash = false; //Random Vacuum Selection if (randomVacInt == 1) dummyVac = true; if (randomVacInt == 2) dummyVac = false; //Random Fire Ext Selection if (randomFireInt == 1) dummyFireExt = true; if (randomFireInt == 2) dummyFireExt = false; //Random Number Languauges dummyNumLangs = random.Next(1, 9); //Random Number of Ships dummyShipsInt = random.Next(1, 6); //Droid Utility Dummy if (randomModelInt == 1) { Droid utilityDummy = new Utility(dummyMaterial, "Utility", dummyColor, dummyToolBox, dummyCompConnection, dummyArm); droidCollection.AddNewDroid(utilityDummy); utilityDummy.CalculateBaseCost(); utilityDummy.CalculateTotalCost(); totalCost += utilityDummy.totalCost; } //Droid Protocol Dummy if (randomModelInt == 2) { Droid protoDummy = new Protocol(dummyMaterial, "Protocol", dummyColor, dummyNumLangs); droidCollection.AddNewDroid(protoDummy); protoDummy.CalculateBaseCost(); protoDummy.CalculateTotalCost(); totalCost += protoDummy.totalCost; } //Droid Janitorial Dummy if (randomModelInt == 3) { Droid janDummy = new Janitorial(dummyMaterial, "Janitor", dummyColor, dummyToolBox, dummyCompConnection, dummyArm, dummyTrash, dummyVac); droidCollection.AddNewDroid(janDummy); janDummy.CalculateBaseCost(); janDummy.CalculateTotalCost(); totalCost += janDummy.totalCost; } //Droid Astromech Dummy if (randomModelInt == 4) { Droid astroDummy = new Astromech(dummyMaterial, "Astromech", dummyColor, dummyToolBox, dummyCompConnection, dummyArm, dummyFireExt, dummyShipsInt); droidCollection.AddNewDroid(astroDummy); astroDummy.CalculateBaseCost(); astroDummy.CalculateTotalCost(); totalCost += astroDummy.totalCost; } } }