Class Ingredient
- java.lang.Object
-
- cs.eng1.piazzapanic.food.ingredients.Ingredient
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisChoppedprotected booleanisCookedprotected FoodTextureManagertextureManager
-
Constructor Summary
Constructors Constructor Description Ingredient(java.lang.String type, FoodTextureManager textureManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ingredient[]arrayFromString(java.lang.String csvIngredientNames, FoodTextureManager textureManager)Initialize an array of ingredients based on the input string.static IngredientfromString(java.lang.String ingredientName, FoodTextureManager textureManager)Initialize an Ingredient based on a string namebooleangetIsChopped()booleangetIsCooked()com.badlogic.gdx.graphics.TexturegetTexture()FoodTextureManagergetTextureManager()java.lang.StringgetType()voidsetIsChopped(boolean value)voidsetIsCooked(boolean value)java.lang.StringtoString()
-
-
-
Field Detail
-
textureManager
protected final FoodTextureManager textureManager
-
isCooked
protected boolean isCooked
-
isChopped
protected boolean isChopped
-
-
Constructor Detail
-
Ingredient
public Ingredient(java.lang.String type, FoodTextureManager textureManager)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fromString
public static Ingredient fromString(java.lang.String ingredientName, FoodTextureManager textureManager)
Initialize an Ingredient based on a string name- Parameters:
ingredientName- the name of the ingredient which can be defined from Tiled- Returns:
- the Ingredient of the type defined by the input
-
arrayFromString
public static Ingredient[] arrayFromString(java.lang.String csvIngredientNames, FoodTextureManager textureManager)
Initialize an array of ingredients based on the input string.- Parameters:
csvIngredientNames- A string containing a list of ingredient names seperated by commas with no whitespace as defined in Tiled- Returns:
- An array of Ingredient based on the input string
-
getType
public java.lang.String getType()
-
getTexture
public com.badlogic.gdx.graphics.Texture getTexture()
-
setIsCooked
public void setIsCooked(boolean value)
-
getIsCooked
public boolean getIsCooked()
-
setIsChopped
public void setIsChopped(boolean value)
-
getIsChopped
public boolean getIsChopped()
-
getTextureManager
public FoodTextureManager getTextureManager()
-
-