public async Task <ProcessAction> GetProcess(int baseItemId, int targetItemId)
        {
            string baseItemName   = GEAdmin.GetNameFromId(baseItemId);
            string targetItemName = GEAdmin.GetNameFromId(targetItemId);

            string processingNameString = baseItemName + " > " + targetItemName;

            int processingCost = FindProcessingCost(processingNameString);

            foreach (ProcessAction i in processList)
            {
                string test = i.ToString();
                if (i.ToString() == processingNameString)
                {
                    return(i);
                }
            }

            Item baseItem = await GEAdmin.GetItemObj(baseItemId).ConfigureAwait(false);

            Item targetItem = await GEAdmin.GetItemObj(targetItemId).ConfigureAwait(false);

            ProcessAction bufferProcess = new ProcessAction(baseItem, targetItem, processingCost);

            processList.Add(bufferProcess);

            return(bufferProcess);
        }
Пример #2
0
        private void ProcessView_MouseClick(object sender, MouseEventArgs e)
        {
            string processName = ProcessView.SelectedItem.ToString();

            string[] itemNames = processName.Split('>');

            itemNames[0] = itemNames[0].Remove(itemNames[0].Length - 1);
            itemNames[1] = itemNames[1].Remove(0, 1);

            int baseItemId   = GEAdmin.GetIdFromName(itemNames[0]);
            int targetItemId = GEAdmin.GetIdFromName(itemNames[1]);

            ProcessAction process = ProcessingAdmin.GetProcess(baseItemId, targetItemId).Result;

            BaseItemNameLabel.Text    = process.BaseItem.name;
            ProductItemNameLabel.Text = process.TargetItem.name;

            BaseItemIcon.Image    = process.BaseItem.image;
            ProductItemIcon.Image = process.TargetItem.image;

            BaseItemPriceLabel.Text    = process.BaseItem.current.price;
            ProductItemPriceLabel.Text = process.TargetItem.current.price;

            ProcessingCostLabel.Text = process.ProcessingCost.ToString();
            ProfitPerItemLabel.Text  = process.GetProcessProfit().ToString();
            ProfitPerInvLabel.Text   = (process.GetProcessProfit() * 27).ToString();

            int baseItemCost;

            switch (process.BaseItem.current.price[process.BaseItem.current.price.Length - 1])
            {
            case 'k':
                baseItemCost  = Convert.ToInt32(String.Join("", process.BaseItem.current.price.Split(',', '.')).Remove(process.BaseItem.current.price.Length - 1));
                baseItemCost *= 1000;
                break;

            case 'm':
                baseItemCost  = Convert.ToInt32(String.Join("", process.BaseItem.current.price.Split(',', '.')).Remove(process.BaseItem.current.price.Length - 1));
                baseItemCost *= 1000000;
                break;

            default:
                baseItemCost = Convert.ToInt32(String.Join("", process.BaseItem.current.price.Split(',', '.')));
                break;
            }

            InvestmentCostLabel.Text = (baseItemCost + process.ProcessingCost).ToString();
        }