示例#1
0
            public List <Drop_GoldModel.DropGold> GetDrops()
            {
                List <Drop_GoldModel.DropGold> list = new List <Drop_GoldModel.DropGold>();
                int random = this.mRandom.GetRandom();

                Drop_GoldModel.DropWeightOne one = this.mList[random];
                for (int i = 0; i < one.Count; i++)
                {
                    Drop_GoldModel.DropGold item = new Drop_GoldModel.DropGold {
                        Gold = GameLogic.Random(one.Min, one.Max + 1)
                    };
                    list.Add(item);
                }
                return(list);
            }
示例#2
0
            public void Init(string[] strs)
            {
                int index  = 0;
                int length = strs.Length;

                while (index < length)
                {
                    char[]   separator = new char[] { ',' };
                    string[] strArray  = strs[index].Split(separator);
                    Drop_GoldModel.DropWeightOne one = new Drop_GoldModel.DropWeightOne {
                        Count  = int.Parse(strArray[0]),
                        Weight = int.Parse(strArray[1]),
                        Min    = int.Parse(strArray[2]),
                        Max    = int.Parse(strArray[3])
                    };
                    this.Add(index, one);
                    index++;
                }
            }
示例#3
0
 private void Add(int id, Drop_GoldModel.DropWeightOne one)
 {
     this.mList.Add(id, one);
     this.mRandom.Add(id, one.Weight);
 }