Class FoodType.ContainerType
A container type is a set of information for a FoodType that determines what Furniture is constructed to hold the food type.
public class FoodType.ContainerType
- Inheritance
-
FoodType.ContainerType
- Inherited Members
- Extension Methods
Constructors
ContainerType(string, bool, Func<bool, FurnitureType>, Func<bool, FurnitureType>, Func<FoodType, TextureRegion>)
Creates a new container type with the given settings.
public ContainerType(string name, bool isDrink, Func<bool, FurnitureType> filled, Func<bool, FurnitureType> empty, Func<FoodType, TextureRegion> texture)
Parameters
name
stringThe name of this container type.
isDrink
boolWhether the container type contains a drink (and should play a drinking sound rather than an eating sound).
filled
Func<bool, FurnitureType>A function that returns the FurnitureType for this container type, based on whether it should contain multiple servings. Can return null if the given type of serving size is not supported.
empty
Func<bool, FurnitureType>A function that returns the FurnitureType that should be used when this container is empty, based on whether the original container held multiple servings or not. Can return null.
texture
Func<FoodType, TextureRegion>A function that returns the texture to use for a FoodType that is stored in this container.
Fields
Bowl
A bowl, which additionally functions as a large serving bowl if the serving size is more than 1.
public static readonly FoodType.ContainerType Bowl
Field Value
Glass
A glass, for protein shakes and water.
public static readonly FoodType.ContainerType Glass
Field Value
IsDrink
Whether the container type contains a drink (and should play a drinking sound rather than an eating sound).
public readonly bool IsDrink
Field Value
Mug
A mug, for drinks like coffee.
public static readonly FoodType.ContainerType Mug
Field Value
Name
The name of this container type.
public readonly string Name
Field Value
Plate
A plate, which additionally functions as a platter if the serving size is more than 1.
public static readonly FoodType.ContainerType Plate
Field Value
Methods
GetDefaultTexture(FoodType)
Returns the texture to use for the given FoodType.
public virtual TextureRegion GetDefaultTexture(FoodType type)
Parameters
type
FoodTypeThe food type whose texture to return.
Returns
- TextureRegion
The texture that the given food type should be drawn with.
GetEmpty(bool)
Returns the FurnitureType that should be used when this container is empty.
public virtual FurnitureType GetEmpty(bool heldMultiple)
Parameters
heldMultiple
boolWhether the original container held multiple servings, or just one.
Returns
- FurnitureType
The furniture to use when this container is empty, or null to use none.
GetFilled(bool)
Returns the FurnitureType for this container type, based on the serving size.
public virtual FurnitureType GetFilled(bool multiple)
Parameters
multiple
boolWhether the container should hold multiple servings.
Returns
- FurnitureType
The furniture for this container type, or null if the given type of serving size is not supported.