Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //A pizza is just a list of FoodTypes
- //It has one crust, one sauce, one cheese, in that order
- //It also has 0-5 toppings at the end, but those can be in any order
- public enum FoodTypes
- {
- CrustRegular, CrustWheat,
- SauceRed, SauceWhite, SaucePink,
- CheeseMozz, CheeseCheddar,
- Pepperoni, Sausage, Bacon, Chicken, MeatBalls, Pepper, Onions, Mushroom, Tomato, Olives
- }
- //This comparison is special
- //It returns false it's impossible to make the given pizza in the recipe by adding more ingredients
- //So a recipie of {CrustRegular}, {SauceRed}
- public bool ComparePartial(List<FoodTypes> recipe, List<FoodTypes> given)
- {
- if (recipe.Count < given.Count) {
- return false;
- }
- //Compare the bread.
- return true;
- }
- private bool IsCheese(FoodTypes food)
- {
- return (food == FoodTypes.CheeseCheddar || food == FoodTypes.CheeseMozz);
- }
- private bool IsCrust(FoodTypes food)
- {
- return (food == FoodTypes.CrustRegular || food == FoodTypes.CrustWheat);
- }
- private bool IsTopping(FoodTypes food)
- {
- return (food >= FoodTypes.Pepperoni);
- }
- private bool IsSauce(FoodTypes food)
- {
- return (food == FoodTypes.SaucePink || food == FoodTypes.SauceRed || food == FoodTypes.SauceWhite);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement