Giter Site home page Giter Site logo

factorio-calculator-core's Introduction

Factorio Calculator Algorithm Build Status

Project history

This is the repository for the Factorio Calculator algorithm. It is a core algorithm to create a tool for calculating resource requirements and production ratios in the game Factorio. The package contains pure javascript implementation of algorithm and not a UI part.

The algorithm is developed by Kirk McDonald as part of Factorio Calculator project. The code is forked from the original Factorio Calculator repository.

The following changes are made to the original code:

  • removed the code related to the DOM document manipulation and html code.
  • Avoid usage of global variables originally defined in settings.js and keeping them inside the FactorySpec object.
  • refactored item class to keep the recipes and uses names instead of objects, avoiding the graph structure and making it serializable.
  • Enforced basic linter rules for modern javascript
  • Packaged and published npm package.

Usage of the package

In order to add the library in your npm project simply type:

npm install --save @kgrech/factorio-calculator-core

Please see example of minimal usage of the package in the example subfolder.

Available APIs

  • FactorySpec
  • Item
  • Module
  • Rational
  • RationalFromFloat
  • Recipe
  • Solver
  • alignCount
  • alignPower
  • alignRate
  • displayCount
  • displayRate
  • formatName
  • getRateAndFactories
  • getRate
  • getFactories
  • getBelts
  • getCategorizedFactories
  • getFuel
  • getFuelUsers
  • getGroups
  • getItemGroups
  • getItemRates
  • getModules
  • getRecipeGraph
  • getSprites
  • one
  • pipeLength
  • pipeThroughput
  • zero
  • gameDataVanilla110
  • gameDataVanilla110Expensive
  • gameDataVanilla100
  • gameDataVanilla100Expensive

npmjs.com package page

See @kgrech/factorio-calculator-core package page.

factorio-calculator-core's People

Contributors

chucklesthebeard avatar darkmattermatt avatar kirkmcdonald avatar mulark avatar rustyblade64 avatar terite avatar

Watchers

 avatar

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.