/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="volume"></param> /// <param name="unitsToRefine"></param> /// <param name="mineralsOut"></param> public Ore(int id, string name, double volume, int unitsToRefine, MineralsOut mineralsOut) { Id = id; Name = name; Volume = volume; _unitsToRefine = unitsToRefine; MineralsOut = mineralsOut; }
/// <summary> /// Вычилсить прибыль и добавить строчку в таблицу /// </summary> /// <param name="ore">тип руды</param> /// <param name="netYield">The net yield.</param> /// <param name="quantity">количество руды для процессинга</param> private double InsertProfitLine(Ore ore, double netYield, int quantity) { int unitProcess = quantity - quantity % ore.UnitsToRefine; int numberOfCycles = quantity / ore.UnitsToRefine; MineralsOut minout = ore.GetMineralsOut(netYield, quantity); double profit = minout.GetMineralProfit(); //Добавляем строчку DataGridViewRow row = new DataGridViewRow(); DataGridViewCell[] cells = new DataGridViewCell[dataGridViewCalc.ColumnCount]; cells[ColumnOreCalc.Index] = new DataGridViewTextBoxCell { Value = ore.Name }; cells[ColumnVolume.Index] = new DataGridViewTextBoxCell { Value = (unitProcess * ore.Volume).ToString("F2") // + " m3" }; cells[ColumnRefVolume.Index] = new DataGridViewTextBoxCell { Value = ((ore.MineralsOut.Tritanium + ore.MineralsOut.Pyerite + ore.MineralsOut.Mexallon + ore.MineralsOut.Isogen + ore.MineralsOut.Nocxium + ore.MineralsOut.Zydrine + ore.MineralsOut.Megacyte + ore.MineralsOut.Morphite) * numberOfCycles * ore.GetEfficiency(netYield) * 0.01).ToString("F2") }; cells[ColumnProfit.Index] = new DataGridViewTextBoxCell { Value = profit.ToString("#,#.##") }; // + " ISK"}; cells[ColumnDelete2.Index] = new DataGridViewButtonCell { Value = "x" }; row.Cells.AddRange(cells); dataGridViewCalc.Rows.Add(row); return(profit); }
/// <summary> /// Refreshes the histogram. /// </summary> /// <param name="minerals">The minerals.</param> private void RefreshHistogram(MineralsOut minerals) { histogram1.Suffix = "k Isk"; histogram1.ListBars.Clear(); Bar bar = new Bar { Color1 = Color.FromArgb(255, 228, 175), Color2 = Color.FromArgb(88, 61, 31), Name = "Tritanium", Value = minerals.Tritanium * Config <Settings> .Instance.PriceTritanium / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0xff, 0xa3, 0x66), Color2 = Color.FromArgb(0x5c, 0x2c, 0x18), Name = "Pyerite", Value = minerals.Pyerite * Config <Settings> .Instance.PricePyerite / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0xf2, 0xff, 0xc7), Color2 = Color.FromArgb(0x3c, 0x50, 0x18), Name = "Mexallon", Value = minerals.Mexallon * Config <Settings> .Instance.PriceMexallon / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0xe4, 0xf3, 0xf7), Color2 = Color.FromArgb(0x2a, 0x80, 0x9c), Name = "Isogen", Value = minerals.Isogen * Config <Settings> .Instance.PriceIsogen / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.Silver, Name = "Nocxium", Value = minerals.Nocxium * Config <Settings> .Instance.PriceNocxium / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0x54, 0x98, 0x3a), Color2 = Color.FromArgb(0x0b, 0x30, 0x10), Name = "Zydrine", Value = minerals.Zydrine * Config <Settings> .Instance.PriceZydrine / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0xc7, 0xbb, 0xa8), Color2 = Color.FromArgb(0x44, 0x37, 0x24), Name = "Megacyte", Value = minerals.Megacyte * Config <Settings> .Instance.PriceMegacyte / 1000 }; histogram1.ListBars.Add(bar); bar = new Bar { Color1 = Color.FromArgb(0xda, 0x4e, 0x40), Color2 = Color.FromArgb(0x48, 0x04, 0x03), //Color1 = Color.DarkRed, Name = "Morphite", Value = minerals.Morphite * Config <Settings> .Instance.PriceMorphite / 1000 }; histogram1.ListBars.Add(bar); histogram1.Invalidate(); textBoxProfit.Text = Resources.CalculatorForm_RefreshHistogram_Total_Profit__ + minerals.GetMineralProfit().ToString("#,#.##") + Resources.CalculatorForm_RefreshHistogram__ISK; }
/// <summary> /// Handles the Click event of the btnCalculateBars control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void BtnCalculateBarsClick(object sender, EventArgs e) { double netYield = 0.5; try { netYield = Convert.ToDouble(textBoxNetYield.Text) / 100; } catch (FormatException) { } //Veldspar int quantity = GetQuantity(textBoxVeldspar0); Ore ore = OreList.Get("Veldspar"); MineralsOut minerals = ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxVeldspar5); ore = OreList.Get("Concentrated Veldspar"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxVeldspar10); ore = OreList.Get("Dense Veldspar"); minerals += ore.GetMineralsOut(netYield, quantity); //Scordite quantity = GetQuantity(textBoxScordite0); ore = OreList.Get("Scordite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxScordite5); ore = OreList.Get("Condensed Scordite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxScordite10); ore = OreList.Get("Massive Scordite"); minerals += ore.GetMineralsOut(netYield, quantity); //Pyroxeres quantity = GetQuantity(textBoxPyroxeres0); ore = OreList.Get("Pyroxeres"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxPyroxeres5); ore = OreList.Get("Solid Pyroxeres"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxPyroxeres10); ore = OreList.Get("Viscous Pyroxeres"); minerals += ore.GetMineralsOut(netYield, quantity); //Plagioclase quantity = GetQuantity(textBoxPlagioclase0); ore = OreList.Get("Plagioclase"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxPlagioclase5); ore = OreList.Get("Azure Plagioclase"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxPlagioclase10); ore = OreList.Get("Rich Plagioclase"); minerals += ore.GetMineralsOut(netYield, quantity); //Omber quantity = GetQuantity(textBoxOmber0); ore = OreList.Get("Omber"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxOmber5); ore = OreList.Get("Silvery Omber"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxOmber10); ore = OreList.Get("Golden Omber"); minerals += ore.GetMineralsOut(netYield, quantity); //Kernite quantity = GetQuantity(textBoxKernite0); ore = OreList.Get("Kernite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxKernite5); ore = OreList.Get("Luminous Kernite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxKernite10); ore = OreList.Get("Fiery Kernite"); minerals += ore.GetMineralsOut(netYield, quantity); //Jaspet quantity = GetQuantity(textBoxJaspet0); ore = OreList.Get("Jaspet"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxJaspet5); ore = OreList.Get("Pure Jaspet"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxJaspet10); ore = OreList.Get("Pristine Jaspet"); minerals += ore.GetMineralsOut(netYield, quantity); //Hemorphite quantity = GetQuantity(textBoxHemorphite0); ore = OreList.Get("Hemorphite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxHemorphite5); ore = OreList.Get("Vivid Hemorphite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxHemorphite10); ore = OreList.Get("Radiant Hemorphite"); minerals += ore.GetMineralsOut(netYield, quantity); //Hedbergite quantity = GetQuantity(textBoxHedbergite0); ore = OreList.Get("Hedbergite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxHedbergite5); ore = OreList.Get("Vitric Hedbergite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxHedbergite10); ore = OreList.Get("Glazed Hedbergite"); minerals += ore.GetMineralsOut(netYield, quantity); //Gneiss quantity = GetQuantity(textBoxGneiss0); ore = OreList.Get("Gneiss"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxGneiss5); ore = OreList.Get("Iridescent Gneiss"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxGneiss10); ore = OreList.Get("Prismatic Gneiss"); minerals += ore.GetMineralsOut(netYield, quantity); //DarkOchre quantity = GetQuantity(textBoxDarkOchre0); ore = OreList.Get("Dark Ochre"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxDarkOchre5); ore = OreList.Get("Onyx Ochre"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxDarkOchre10); ore = OreList.Get("Obsidian Ochre"); minerals += ore.GetMineralsOut(netYield, quantity); //Spodumain quantity = GetQuantity(textBoxSpodumain0); ore = OreList.Get("Spodumain"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxSpodumain5); ore = OreList.Get("Bright Spodumain"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxSpodumain10); ore = OreList.Get("Gleaming Spodumain"); minerals += ore.GetMineralsOut(netYield, quantity); //Crokite quantity = GetQuantity(textBoxCrockite0); ore = OreList.Get("Crokite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxCrockite5); ore = OreList.Get("Sharp Crokite"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxCrockite10); ore = OreList.Get("Crystalline Crokite"); minerals += ore.GetMineralsOut(netYield, quantity); //Bistot quantity = GetQuantity(textBoxBistot0); ore = OreList.Get("Bistot"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxBistot5); ore = OreList.Get("Triclinic Bistot"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxBistot10); ore = OreList.Get("Monoclinic Bistot"); minerals += ore.GetMineralsOut(netYield, quantity); //Arkonor quantity = GetQuantity(textBoxArkonor0); ore = OreList.Get("Arkonor"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxArkonor5); ore = OreList.Get("Crimson Arkonor"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxArkonor10); ore = OreList.Get("Prime Arkonor"); minerals += ore.GetMineralsOut(netYield, quantity); //Mercoxit quantity = GetQuantity(textBoxMercoxit0); ore = OreList.Get("Mercoxit"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxMercoxit5); ore = OreList.Get("Magma Mercoxit"); minerals += ore.GetMineralsOut(netYield, quantity); quantity = GetQuantity(textBoxMercoxit10); ore = OreList.Get("Vitreous Mercoxit"); minerals += ore.GetMineralsOut(netYield, quantity); RefreshHistogram(minerals); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="volume"></param> /// <param name="unitsToRefine"></param> /// <param name="mineralsOut"></param> public Ore(int id, string name, double volume, int unitsToRefine, MineralsOut mineralsOut) { Id = id; Name = name; Volume = volume; _unitsToRefine = unitsToRefine; MineralsOut = mineralsOut; }