Exemplo n.º 1
0
        private static void CalculateNormalDropRates(DropNormalEntry entry, bool isUm)
        {
            List <DropEntry <MaterialEntry> > materialsSingle = entry.MaterialsSingle;
            List <DropEntry <MaterialEntry> > materialsDouble = entry.MaterialsDouble;

            double rate0 = (double)materialsSingle[0].Rate / 100;
            double rate1 = (double)materialsSingle[1].Rate / 100;

            materialsDouble[0].LotDropRate   = rate0;
            materialsDouble[0].TotalDropRate = rate0;

            materialsDouble[1].LotDropRate   = (1 - rate0) + rate0 * rate1;
            materialsDouble[1].TotalDropRate = (1 - rate0) + rate0 * rate1;

            if (isUm)
            {
                materialsSingle[0].LotDropRate   = rate0;
                materialsSingle[0].TotalDropRate = rate0;

                materialsSingle[1].LotDropRate   = 1 - rate0;
                materialsSingle[1].TotalDropRate = 1 - rate0;
            }
            else
            {
                materialsSingle[0].LotDropRate   = 1;
                materialsSingle[0].TotalDropRate = 1;

                materialsSingle[1].LotDropRate   = 0;
                materialsSingle[1].TotalDropRate = 0;
            }
        }
Exemplo n.º 2
0
        private static DropNormalEntry TryGetNormalTable(BdatStringItem row)
        {
            var entry = new DropNormalEntry();

            for (int i = 0; i < MaxLotItems; i++)
            {
                DropEntry <MaterialEntry> item = GetMaterialEntry(row, i);
                if (item == null)
                {
                    break;
                }

                entry.MaterialsSingle.Add(item);
                entry.MaterialsDouble.Add(GetMaterialEntry(row, i));
            }

            return(entry);
        }