Class SpawnerType
- Namespace
- TinyLife.Objects
- Assembly
- TinyLife.dll
[JsonConverter(typeof(MigratingStaticJsonConverter<SpawnerType>), new object[] { typeof(SpawnerType), "PrivateTypes", true })]
public class SpawnerType
- Inheritance
-
SpawnerType
- Inherited Members
-
- Extension Methods
-
Constructors
SpawnerType(string, TextureRegion, TimeSpan, int[], int, int, Func<Map, Point, int, bool>, params (SpawnerDelegate Spawn, float Weight)[])
public SpawnerType(string name, TextureRegion icon, TimeSpan interval, int[] ranges, int amountPerSpawn, int maxAmountInRange, Func<Map, Point, int, bool> isValidSpawnPosition, params (SpawnerType.SpawnerDelegate Spawn, float Weight)[] spawnChoices)
Parameters
name string
icon TextureRegion
interval TimeSpan
ranges int[]
amountPerSpawn int
maxAmountInRange int
isValidSpawnPosition Func<Map, Point, int, bool>
spawnChoices (SpawnerDelegate Spawn, float Weight)[]
Fields
AmountPerSpawn
public readonly int AmountPerSpawn
Field Value
- int
Icon
public readonly TextureRegion Icon
Field Value
- TextureRegion
Interval
public readonly TimeSpan Interval
Field Value
- TimeSpan
IsValidSpawnPosition
public readonly Func<Map, Point, int, bool> IsValidSpawnPosition
Field Value
- Func<Map, Point, int, bool>
MaxAmountInRange
public readonly int MaxAmountInRange
Field Value
- int
Name
public readonly string Name
Field Value
- string
Ranges
public readonly int[] Ranges
Field Value
- int[]
SpawnChoices
public readonly (SpawnerType.SpawnerDelegate Spawn, float Weight)[] SpawnChoices
Field Value
- (SpawnerDelegate Spawn, float Weight)[]
Types
public static readonly ReadOnlyDictionary<string, SpawnerType> Types
Field Value
- ReadOnlyDictionary<string, SpawnerType>
Methods
CreatePlantSpawner(string, TimeSpan, int[], int, int, params PlantType[])
public static SpawnerType CreatePlantSpawner(string name, TimeSpan interval, int[] ranges, int amountPerSpawn, int maxAmountInRange, params PlantType[] types)
Parameters
name string
interval TimeSpan
ranges int[]
amountPerSpawn int
maxAmountInRange int
types PlantType[]
Returns
- SpawnerType
Register(SpawnerType)
public static SpawnerType Register(SpawnerType type)
Parameters
type SpawnerType
Returns
- SpawnerType