예제 #1
0
        public List <string> DealInfo(string nMatTime, string nBid, string nAsk, string nMatPri, NPlot.Windows.PlotSurface2D PS)
        {
            List <string> deal = new List <string>();

            int i;

            //order -> deal
            for (i = 0; i < OrdList.Count; i++)
            {
                if (OrdList[i].BS.Equals("B") && OrdList[i].Price.Equals("M") ||
                    OrdList[i].BS.Equals("B") && int.Parse(nAsk) <= int.Parse(OrdList[i].Price))
                {
                    MatList.Add(new match(nMatTime, OrdList[i].FutNo, OrdList[i].BS, OrdList[i].Qty, nAsk, ""));
                    deal.Add(nAsk + ",B," + OrdList[i].Price);
                    DeleteNotMat(OrdList, OrdList[i].BS, OrdList[i].Price, PS);
                    //OrdList.Remove(OrdList[i]);
                }
                else if (OrdList[i].BS.Equals("S") && OrdList[i].Price.Equals("M") ||
                         OrdList[i].BS.Equals("S") && int.Parse(nBid) >= int.Parse(OrdList[i].Price))
                {
                    MatList.Add(new match(nMatTime, OrdList[i].FutNo, OrdList[i].BS, OrdList[i].Qty, nBid, ""));
                    deal.Add(nBid + ",S," + OrdList[i].Price);
                    DeleteNotMat(OrdList, OrdList[i].BS, OrdList[i].Price, PS);
                    //OrdList.Remove(OrdList[i]);
                }
            }
            return(deal);
        }
예제 #2
0
        public static void MoveThroughMatList(int step, MatList matList)
        {
            if (matList.mats.Count <= 0)
            {
                Logger.log.Debug("Material list is empty! Ensure mod part lists are installed in ../BeatSaber/SaberForgeParts");
                return;
            }

            matList.index += step;

            if (matList.index >= matList.mats.Count)
            {
                matList.index = 0;
            }

            else if (matList.index < 0)
            {
                matList.index = matList.mats.Count - 1;
            }

            //set text
            UIFunctions.UpdateAllMatLabels();

            if (step != 0)
            {
                onMaterialChange();
            }
        }
예제 #3
0
        public static Material FindMaterialInList(string matRefName, MatList matList)
        {
            Material mat = null;

            for (int i = 0; i < matList.mats.Count; i++)
            {
                if (matList.mats[i].materialReferenceName == matRefName)
                {
                    mat = matList.mats[i].material;
                }
            }

            return(mat);
        }