Class FoodItem
Food Items are items that spoil over time, See DurabilityItems.md
Inheritance
System.Object
FoodItem
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
[Compostable]
[ItemGroup("Food")]
public abstract class FoodItem : SpoilageItem, IItem, ILinkableParameterized<LinkConfig>, ILinkable, IHasIcon, INotifyPropertyChanged, IInteractor, IHasInteractions, IPlaceableItem, IController, IViewController, IHasUniversalID
Constructors
FoodItem()
Declaration
Properties
Calories
Declaration
public abstract float Calories { get; }
Property Value
| Type |
Description |
| System.Single |
|
CanBeHeld
Declaration
public override bool CanBeHeld { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
Nutrition
Declaration
public abstract Nutrients Nutrition { get; }
Property Value
WorldObjectType
Declaration
public Type WorldObjectType { get; }
Property Value
| Type |
Description |
| System.Type |
|
Methods
Consume(Player)
RPC that is called by client when its time to actually remove food item from inventory an eat it
Declaration
public virtual string Consume(Player player)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
Returns
| Type |
Description |
| System.String |
|
EatFromSurface(Player, WorldObject)
Tiny action to consume food from when it placed on surfaces as object
Declaration
public bool EatFromSurface(Player player, WorldObject table)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
GetQualityGroup()
Declaration
public override int GetQualityGroup()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
OnUsed(Player, ItemStack)
On food item right click - we point toolbar override slot with this item stack of food. for client so it knows what item will be used
Also we immediately call consume (so item will be eaten with calories and removed from inventory)
Declaration
public override string OnUsed(Player player, ItemStack itemStack)
Parameters
Returns
| Type |
Description |
| System.String |
|
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods