Developed in Unity 2022.3.11f1 (Updated from 2021.3.22f1)
As meals are built on a plate, I wanted to have a quick and cheap way to detect whether the meal is currently waiting to be delivered or not. Each recipe requires a specific number of ingredients and the players should be able to add them in any order. At first, I was just going to use a Set or a Hash Map to detect if the correct amount of ingredients were used. Instead, I opted to use a string of integers, where each integer dictates the ingredients as shown in the picture above.
For example, a double cheeseburger requires 1 bread, 1 lettuce, 2 cheeses, 1 tomato, and 2 cooked meats. The meal would then have a meal string of "112102". Alternatively, a salad would require 1 lettuce and 1 tomato resulting in a meal string of "010100". Note that burnt meat can be accidentally placed in a meal, which would then need to be thrown away, as no recipe would call for burnt meat.
Justin Salanga 2024