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<int, FurnitureType>, Func<bool, FurnitureType>, Func<FoodType, TextureRegion>)
Creates a new container type with the given settings.
public ContainerType(string name, bool isDrink, Func<int, 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<int, FurnitureType>A function that returns the FurnitureType for this container type, based on the serving size.
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.
texture
Func<FoodType, TextureRegion>A function that returns the texture to use for a FoodType that is stored in this container.
Fields
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.
GetFilled(int)
Returns the FurnitureType for this container type, based on the serving size.
public virtual FurnitureType GetFilled(int servingSize)
Parameters
servingSize
intThe serving size to use.
Returns
- FurnitureType
The furniture for this container type.