Giter Site home page Giter Site logo

factorio-blueprintalignment's People

Contributors

mrudat avatar steffen-kiess avatar

Watchers

 avatar  avatar  avatar

Forkers

mrudat

factorio-blueprintalignment's Issues

Enhancement: Smaller, more readable JSON style property encoding

How about using:

Some blueprint {align:[16,8]}
to shorten
Some blueprint (alignx = 16, aligny = 8)

and

Some blueprint {align:[16,8,0,0,10,10]}
to shorten
Some blueprint (alignx = 16, aligny = 8, offsetx = 0, offsety = 0, roffsetx = 10, roffsety = 10)
?

Pros:

  • much shorter and arguably more readable
  • can use generic json parser to build properties object from the text beginning at the first '{'.
    • (it's not strictly well formed json without quotes around the keys but many parsers including the javascript one work with this format, apparently)
  • simple to encode additional properties with less compatibility risk.
    • it would be easy to encode info for other mods in the name without them interfering with each other using json syntax that is familiar to many people.

Cons:

  • : may cause issues if saving blueprints using their name as the filename.
    • Workaround: allow using ; as well (replace before parse) - it looks almost the same and causes no issues with file system.
  • not strictly well formed json so may break if javascript parser changes to be strict.
    • Workaround: allow using quotes and use regex to insert missing quotes after top level { and before next : before parsing.

You could even separate property decoding into another module or mod even for other blueprint mods to use.

I'd just like a shorter name without reducing readability or simplicity though, which I think a JSON style would give with other benefits too.

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.