-
Notifications
You must be signed in to change notification settings - Fork 19
Engine initialization
You need three things to initialize engine: data handler, instance name, path to the folder where operational data can be stored + optional flag which controls if this instance of engine will be marked as default or not.
data_handler = JsonDataHandler('data_folder/phobos/')
engine = Eos(data_handler, name='eos', storage_path='data_folder/', make_default=True)
It will provide access to the data Eos needs. There're 2 built-in data handlers:
- [JsonDataHandler] (https://github.com/DarkFenX/Eos/blob/master/data/data_handler/json_data_handler.py), which takes path to folder with [Phobos] (https://github.com/DarkFenX/Phobos) JSON dump as initialization argument
- [SQLiteDataHandler] (https://github.com/DarkFenX/Eos/blob/master/data/data_handler/sqlite_data_handler.py) which takes path to SQLite database as initialization argument
Of course, you can write your own handler as needed. Interface is defined in abstract base class.
Data-wise, Eos needs access to following tables and fields:
- invtypes
- typeID
- groupID
- radius
- mass
- volume
- capacity
- invgroups
- groupID
- categoryID
- dgmattribs
- attributeID
- maxAttributeID
- defaultValue
- highIsGood
- stackable
- dgmtypeattribs
- typeID
- attributeID
- value
- dgmeffects
- effectID
- effectCategory
- isOffensive
- isAssistance
- durationAttributeID
- dischargeAttributeID
- rangeAttributeID
- falloffAttributeID
- trackingSpeedAttributeID
- fittingUsageChanceAttributeID
- preExpression
- postExpression
- modifierInfo
- dgmtypeeffects
- typeID
- effectID
- isDefault
- dgmexpressions
- expressionID
- operandID
- arg1
- arg2
- expressionValue
- expressionTypeID
- expressionGroupID
- expressionAttributeID
- phbmetadata (just client build data is needed)
- field_name
- field_value
Eos allows you to have multiple instances within single python instances, this might be useful to be able to work with Tranquility and Singularity fits at the same time. To make sure Eos' auxiliary facilities operate correctly, give each instance unique name.
It is place where logs and cache will be stored. Can be shared across multiple Eos instances, cache/log names will contain Eos instance name to avoid being overwritten.
If true, all fits created within current python interpreter will be attached to this Eos instance by default; otherwise, you will have to pass Eos instance each time you instantiate a fit.
You can override default logger and cache handler if needed. Refer to [eos.py] (https://github.com/DarkFenX/Eos/blob/master/eos.py) for more info.