Class PlantGameActions
Plant related game actions.
Inheritance
System.Object
PlantGameActions
Namespace: Eco.Gameplay.Plants
Assembly: Eco.Gameplay.dll
Syntax
public static class PlantGameActions : Object
Fields
PlantSeededEvent
Declaration
public static ThreadSafeAction<User, PlantSpecies> PlantSeededEvent
Field Value
Type | Description |
---|---|
ThreadSafeAction<User, PlantSpecies> |
Methods
AddSeedAction(GameActionPack, PlantSpecies, Vector3i, User, Item)
Adds plant seed action to pack
and spawn tended plant as post effect.
Declaration
public static void AddSeedAction(this GameActionPack pack, PlantSpecies species, Vector3i spawnPos, User seeder, Item tool = null)
Parameters
Type | Name | Description |
---|---|---|
GameActionPack | pack | |
PlantSpecies | species | |
Vector3i | spawnPos | |
User | seeder | |
Item | tool |
TrySeed(PlantSpecies, Vector3i, User, Item)
Creates GameActionPack, adds plant seed action to it and tries to perform.
Declaration
public static Result TrySeed(this PlantSpecies species, Vector3i spawnPos, User seeder, Item tool = null)
Parameters
Type | Name | Description |
---|---|---|
PlantSpecies | species | |
Vector3i | spawnPos | |
User | seeder | |
Item | tool |
Returns
Type | Description |
---|---|
Result |
TrySeedFromInventory(SeedItem, ItemStack, Inventory, Vector3i, User, Item)
Creates GameActionPack, adds plant seed action to it, removes seed item from inventory and tries to perform.
Declaration
public static Result TrySeedFromInventory(this SeedItem seed, ItemStack stack, Inventory inventory, Vector3i spawnPos, User seeder, Item tool = null)
Parameters
Type | Name | Description |
---|---|---|
SeedItem | seed | |
ItemStack | stack | |
Inventory | inventory | |
Vector3i | spawnPos | |
User | seeder | |
Item | tool |
Returns
Type | Description |
---|---|
Result |