Code Monkey home page Code Monkey logo

Comments (2)

skaldarnar avatar skaldarnar commented on July 19, 2024

I guess this could potentially be modelled using different recipes, right? Maybe we can discuss here a bit how you would like to specify optional ingredients and their effects. You would need to specify the optional ingredient along with the desired effect (modifier) I suppose, like

"optionalIngredients" : [
    { "component" : "2*Cooking:salt", "effect" : "..." }
]

This would directly link the recipe to the properties of the resulting item. Can you think of a general way this could be defined?

from cooking.

xrtariq2594 avatar xrtariq2594 commented on July 19, 2024

Hmm, it could be modeled using different recipe prefabs. But, that causes issues when we have several minor variants and combinations of the same base food. For example, according to Wikipedia, Guacamole can have "tomato, onion, garlic, lemon or lime juice, chili or cayenne pepper, coriander (also known as cilantro) or basil, jalapeño, and/or additional seasonings." It gets more complex with things like bread, cookies, and cakes.

I suppose a mix of individual recipes per "base" food and optional ingredients is a good compromise. The above syntax was what I was thinking about for optionalIngredients. Technically, we could apply the same principle of optional ingredients/items to other things like potion, equipment, etc.

We at the very least need the name of the optional item and what effects it should have on the altered base product. We'll have an optionalIngredients list which stores elements of the type OptionalIngredient, a custom class containing the aforementioned two fields (name and effect). Though, we'll need some way to parse the effect.

from cooking.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.