1.0.15 • Published 4 years ago

@kgrech/factorio-calculator-core v1.0.15

Weekly downloads
13
License
Apache-2.0
Repository
github
Last release
4 years ago

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.

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.1-beta

4 years ago

1.0.0

4 years ago