public static IWorldSpawnBuilder WithSettings(this IWorldSpawnBuilder builder, WorldSpawnSettings settings) { settings.PrefabName.Set(builder.SetPrefabName); settings.Enabled.Set(builder.SetEnabled); settings.Biomes.Set(builder.SetConditionBiomes); settings.MaxSpawned.Set(builder.SetMaxSpawned); settings.SpawnInterval.Set(builder.SetSpawnInterval); settings.SpawnChance.Set(builder.SetSpawnChance); settings.PackSpawnCircleRadius.Set(builder.SetPackSpawnCircleRadius); settings.PackSizeMin.Set(builder.SetPackSizeMin); settings.PackSizeMax.Set(builder.SetPackSizeMax); settings.SpawnInForest.Set(builder.SetSpawnInForest); settings.SpawnOutsideForest.Set(builder.SetSpawnOutsideForest); settings.DistanceToCenterForLevelUp.Set(builder.SetDistanceToCenterForLevelUp); settings.MinLevel.Set(builder.SetMinLevel); settings.MaxLevel.Set(builder.SetMaxLevel); settings.ConditionMinAltitude.SetNullable(builder.SetConditionAltitudeMin); settings.ConditionMaxAltitude.SetNullable(builder.SetConditionAltitudeMax); settings.ConditionMinOceanDepth.SetNullable(builder.SetConditionOceanDepthMin); settings.ConditionMaxOceanDepth.SetNullable(builder.SetConditionOceanDepthMax); settings.ConditionMinTilt.SetNullable(builder.SetConditionTiltMin); settings.ConditionMaxTilt.SetNullable(builder.SetConditionTiltMax); settings.ConditionEnvironments.Set(builder.SetConditionEnvironments); settings.ConditionRequiredGlobalKey.Set(builder.SetConditionRequiredGlobalKey); settings.SpawnDuringDay.Set(builder.SetSpawnDuringDay); settings.SpawnDuringNight.Set(builder.SetSpawnDuringNight); settings.MinDistanceToOther.Set(builder.SetMinDistanceToOther); settings.SpawnAtDistanceToPlayerMin.SetNullable(builder.SetSpawnAtDistanceToPlayerMin); settings.SpawnAtDistanceToPlayerMax.SetNullable(builder.SetSpawnAtDistanceToPlayerMax); settings.SpawnAtDistanceToGround.SetNullable(builder.SetSpawnAtDistanceToGround); foreach (var condition in settings.Conditions) { builder.SetCondition(condition); } foreach (var condition in settings.PositionConditions) { builder.SetPositionCondition(condition); } foreach (var modifier in settings.Modifiers) { builder = builder.SetModifier(modifier); } return(builder); }
/// <summary> /// Sets locations in which spawning is allowed during spawn position checks. /// </summary> public static IWorldSpawnBuilder SetPositionConditionLocation(this IWorldSpawnBuilder builder, params string[] locationNames) { builder.SetPositionCondition(new PositionConditionLocation(locationNames)); return(builder); }
/// <summary> /// Sets locations in which spawning is allowed during spawn position checks. /// </summary> public static IWorldSpawnBuilder SetPositionConditionLocation(this IWorldSpawnBuilder builder, IEnumerable <string> locationNames) { builder.SetPositionCondition(new PositionConditionLocation(locationNames)); return(builder); }