Interface IMyFarmPlotLogic
Describes the exposed farm plot logic.
Inherited Members
Namespace: Sandbox.ModAPI
Assembly: Sandbox.Common.dll
Syntax
public interface IMyFarmPlotLogic : IMyFarmPlotLogic
Methods
Harvest()
Harvests the plant and puts the output items into the current player's inventory.
Declaration
void Harvest()
Harvest(IMyInventory)
Harvests the plant and puts the output items into the specified inventory. Only works when called from the server.
Declaration
void Harvest(IMyInventory inventory)
Parameters
Type | Name | Description |
---|---|---|
IMyInventory | inventory | The inventory to place the gathered items into. |
PlantSeed(IMyInventoryItem)
Plants a given seed and starts growing the plant. The specified seed item will be removed from the current player's inventory.
Declaration
void PlantSeed(IMyInventoryItem inventoryItem)
Parameters
Type | Name | Description |
---|---|---|
IMyInventoryItem | inventoryItem | Needs to have an item with content of type MySeedItemDefinition. |
RemovePlant(Boolean)
Removes the currently planted plant and its seed.
Declaration
void RemovePlant(bool playSound = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | playSound | Whether the "gather" sound specified in block's definition should be played. |
Events
OnHarvestResult
Triggered when a harvest action has been completed on the server. The bool indicates whether the action was successful.
Declaration
event Action<bool> OnHarvestResult
Event Type
Type | Description |
---|---|
System.Action<System.Boolean> |
OnPlantResult
Triggered when a plant action has been completed on the server. The bool indicates whether the action was successful.
Declaration
event Action<bool> OnPlantResult
Event Type
Type | Description |
---|---|
System.Action<System.Boolean> |