Ejemplo n.º 1
0
        public ISpawnList GetList(Type type)
        {
            ISpawnList result = (ISpawnList)Activator.CreateInstance(type);

            foreach (SpawnListElement item in Collection)
            {
                result.Add(item.Value, item.Weight);
            }
            return(result);
        }
Ejemplo n.º 2
0
 public void LoadFromList(ISpawnList source)
 {
     Collection.Clear();
     for (int ii = 0; ii < source.Count; ii++)
     {
         object obj  = source.GetSpawn(ii);
         int    rate = source.GetSpawnRate(ii);
         Collection.Add(new SpawnListElement(StringConv, rate, (double)rate / source.SpawnTotal, obj));
     }
 }
Ejemplo n.º 3
0
 public void LoadFromList(Type type, ISpawnList source)
 {
     Collection = (ISpawnList)Activator.CreateInstance(type);
     for (int ii = 0; ii < source.Count; ii++)
     {
         object obj  = source.GetSpawn(ii);
         int    rate = source.GetSpawnRate(ii);
         Collection.Add(obj, rate);
     }
     for (int ii = 0; ii < source.Count; ii++)
     {
         lbxCollection.Items.Add(getSpawnString(ii));
     }
 }