//***********************END ADD JANITOR METHOD***********************// //**********************ADD ASTROMECH METHOD*************************// public void AddAstromech() { DroidOptions("Astromech"); Console.WriteLine(); Droid newAstromech = new Astromech(materailSelectionString, "Astromech", colorSelectionString, toolBox, computerConnection, arm, fireExtinquisher, numberShips); droidCollection.AddNewDroid(newAstromech); newAstromech.CalculateBaseCost(); newAstromech.CalculateTotalCost(); totalCost += newAstromech.totalCost; Console.WriteLine(newAstromech + 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; } } }
//**********************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; } } }