Esempio n. 1
0
 public SpawnList(SpawnList list)
 {
     entries = new SpawnEntry[list.entries.Length];
     for (int i = 0; i < entries.Length; i++)
     {
         entries[i] = new SpawnEntry(list.entries[i]);
     }
 }
Esempio n. 2
0
        public Container SpawnContents(SpawnList list, double weight = 1, bool spawnNow = true)
        {
            spawnLists.Add(list);

            if (spawnNow)
            {
                list.Spawn(this, weight);
            }

            return(this);
        }
Esempio n. 3
0
        public override Dictionary <string, object> GenerateData(Dictionary <string, object> context = null)
        {
            Dictionary <string, object> data = base.GenerateData(context);

            double v = innerVolume.GetValue(data);

            if (v < 0)
            {
                v = double.PositiveInfinity;
            }
            data["innerVolume"] = v;

            if (spawnLists != null && spawnLists.Length > 0)
            {
                SpawnList[] spawns = new SpawnList[spawnLists.Length];
                for (int i = 0; i < spawnLists.Length; i++)
                {
                    spawns[i] = spawnLists[i].LoadData <SpawnList>(typeof(SpawnList));
                }
                data["spawnLists"] = spawns;
            }

            return(data);
        }