public static PaintHASS createInstance(Color color, double price) { if (paint != null) { return(paint); } else { paint = new PaintHASS(Color.Blue, price); return(paint); } }
public void loadPrices() { double price; reader = File.OpenText("roof_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Roof.createInstance(price); reader.Close(); reader = File.OpenText("foundation_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Foundation.createInstance(price); reader.Close(); reader = File.OpenText("siding_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Siding.createInstance(price); reader.Close(); reader = File.OpenText("door_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Door.createInstance(price); reader.Close(); reader = File.OpenText("window_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Window.createInstance(price); reader.Close(); reader = File.OpenText("paint_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = PaintHASS.createInstance(Color.White, price); reader.Close(); reader = File.OpenText("oceanside.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Oceanside.createInstance(price); reader.Close(); reader = File.OpenText("city.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = City.createInstance(price); reader.Close(); reader = File.OpenText("desert.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Desert.createInstance(price); reader.Close(); reader = File.OpenText("private_island.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = PrivateIsland.createInstance(price); reader.Close(); reader = File.OpenText("country.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Country.createInstance(price); reader.Close(); reader = File.OpenText("suburb.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Suburb.createInstance(price); reader.Close(); }
public static PaintHASS createInstance() { if (paint != null) { return(paint); } else { paint = new PaintHASS(Color.Blue); return(paint); } }
public void loadPrices() { double price; reader = File.OpenText("roof_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Roof.createInstance(price); roofLabel.Text = part.getPrice().ToString(); reader = File.OpenText("foundation_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Foundation.createInstance(price); foundationLabel.Text = price.ToString(); reader = File.OpenText("siding_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Siding.createInstance(price); sidingLabel.Text = price.ToString(); reader = File.OpenText("door_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Door.createInstance(price); doorLabel.Text = price.ToString(); reader = File.OpenText("window_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Window.createInstance(price); windowLabel.Text = price.ToString(); reader = File.OpenText("floor_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = Floor.createInstance(price); floorLabel.Text = price.ToString(); reader = File.OpenText("paint_prices.txt"); price = Convert.ToDouble(reader.ReadLine()); part = PaintHASS.createInstance(c, price); label8.Text = price.ToString(); reader = File.OpenText("oceanside.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Oceanside.createInstance(price); reader = File.OpenText("city.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = City.createInstance(price); reader = File.OpenText("desert.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Desert.createInstance(price); reader = File.OpenText("private_island.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = PrivateIsland.createInstance(price); reader = File.OpenText("country.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Country.createInstance(price); reader = File.OpenText("suburb.txt"); price = Convert.ToDouble(reader.ReadLine()); loc = Suburb.createInstance(price); }