Module builder
Provides the class that actually handles building and updating the modular constructions
Functions
| modConBuilder (builderID, removerFileName, constructionFileName) | Constructor returning modConBuilderInstance |
Class modConBuilderInstance
| modConBuilderInstance:defineModule (key, data) | Add/update a module definition |
| modConBuilderInstance:getModulePreview (key, params) | Get the preview data for the specified module as a table that can be returned from the upgradeFn |
| modConBuilderInstance:getEntityBySeed (seed) | Get the entity id for the given seed |
| modConBuilderInstance:getDataBySeed (seed) | Get construction data referenced by the given seed |
| modConBuilderInstance:buildCon (seed, range[, extend=false]) | Try to merge modules in the defined circle to a single construction or add them to an existing construction |
| modConBuilderInstance:upgradeCon (seed, range) | Get the modular construction defined by seed and split it into its modules |
Functions
- modConBuilder (builderID, removerFileName, constructionFileName)
-
Constructor returning modConBuilderInstance
Parameters:
- builderID string unique name for this builder
- removerFileName string filename of the module which removes parts of the construction
- constructionFileName string filename of the construction which defines the building circle and where the modules are integrated to
Returns:
Class modConBuilderInstance
Base class for modular constructions
- modConBuilderInstance:defineModule (key, data)
-
Add/update a module definition
Parameters:
- key string module filename
- data util.moduleDefinition can be a function taking the params table and returning a util.moduleDefinition instead
- modConBuilderInstance:getModulePreview (key, params)
-
Get the preview data for the specified module as a table that can be returned from the upgradeFn
Parameters:
- key string module filename, see modConBuilderInstance:defineModule
- params {[string]=number,...} params provided by the updateFn
Returns:
- modConBuilderInstance:getEntityBySeed (seed)
-
Get the entity id for the given seed
Parameters:
- seed number
Returns:
- modConBuilderInstance:getDataBySeed (seed)
-
Get construction data referenced by the given seed
Parameters:
- seed number
Returns:
- modConBuilderInstance:buildCon (seed, range[, extend=false])
-
Try to merge modules in the defined circle to a single construction or add them to an existing construction
Parameters:
- seed number
- range number
- extend boolean (default false)
- modConBuilderInstance:upgradeCon (seed, range)
-
Get the modular construction defined by seed and split it into its modules
Parameters:
- seed number
- range number