Posted July 03, 2021 by pr00thmatic
today I implemented this thing: We have RawCookingReagent that can be placed into CookingRecipients, and when that happens, the RawCookingReagent gets destroyed, and it's ContextualCookingReagent gets parented into the pan's contextual representation.
The EggManager got replaced by a ContextualEgg component that belongs to the ContextualCookingReagent (before, it belong to the ContextualStove... can you believe it??? WHAT WAS I THINKING?!?!)
So when a ContextualCookingReagent gets put into a CookingRecipient it subscribes to the recipient's events that he needs to listen, and observes the variables that he requires to work. For example, he'll listen to the Pan's onWash event and destroy itself if the pan is washed, or if the pan has an hornilla, it will play the animations that show that he's getting cooked.
The ContextualEgg is also responsible of "showing, sliding and splashing" the egg that shows inside of the pan.
The egg inside of the pan has a CookedEggInPan, that belongs to the ContextualEgg, and if the pan gets used, the ContextualEgg will know how to behave whether or not it's "owner" ContextualEgg is stuck to the pan, or is burned, or is raw.
I know it looks kind of confusing right now, but maybe tomorrow I'll implement a pot and vegetables cooking and everything will get easier! after all, the CookedEggInPan might be better as a "CookedReagentInPan", but we'll see tomorrow, or whenever I implement the cooking of more food xD there are a few things that are more crytical right now... like allowing Rafa to register his entering hour to work, and making some endings... we'll see, we'll see...