Giter VIP home page Giter VIP logo

Comments (5)

Afforess avatar Afforess commented on June 3, 2024 1

@Choumiko FYI, I recently started on this. I went with a jquery selector ... inspired solution. Here's the commit: bca9d78

Example:
Data.select("recipe:copper.*) -- selects all recipes matching copper.*
Recipe.select("copper.*) -- selects all recipes matching copper.*
Recipe.select("copper.*:ingredients:copper.*") -- selects all ingredients whose name matches 'copper.*' in recipes matching copper.*

from factorio-stdlib.

Afforess avatar Afforess commented on June 3, 2024

Yes, definitely. I've written a few things like this before for Marathon. Data manipulation is often a pain, and it would be nice to have easy functions for.

from factorio-stdlib.

Afforess avatar Afforess commented on June 3, 2024

I also wrote a metatable that is dynamically assigned to the recipe fields 'ingredients' and 'results', which detects the layout of the item, and emulates the 'amount' and 'name' fields when the item object is an array, or emulates the '1' and '2' fields if the item is a table. This should allow modders to stop trying to write code for either way and detecting, and just use the named fields when accessing, but write the shorthand array when updating recipes.

from factorio-stdlib.

Afforess avatar Afforess commented on June 3, 2024

The very basics of this was added to 0.6.0, but more work needs to be done to support specific data structures.

https://github.com/Afforess/Factorio-Stdlib/releases/tag/0.6.0

from factorio-stdlib.

boweiliu avatar boweiliu commented on June 3, 2024

What's our progress so far? What remains to be done on this issue?

from factorio-stdlib.

Related Issues (20)

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.