Пример #1
0
        public SpawnConfig(
            ProtoZoneSpawnScript zoneScript,
            double densityMultiplier) : base(zoneScript)
        {
            if (double.IsInfinity(densityMultiplier) ||
                double.IsNaN(densityMultiplier))
            {
                throw new ArgumentException("Invalid density multiplier", nameof(densityMultiplier));
            }

            this.DensityMultiplier = densityMultiplier;
        }
Пример #2
0
        public static SpawnedMobsTrackingManager Get(ProtoZoneSpawnScript script, IServerZone serverZone)
        {
            var key = new KeyValuePair <ProtoZoneSpawnScript, IServerZone>(script, serverZone);

            if (!Managers.TryGetValue(key, out var mobsTrackingManager))
            {
                mobsTrackingManager = new SpawnedMobsTrackingManager();
                Managers[key]       = mobsTrackingManager;
            }

            return(mobsTrackingManager);
        }