esf
Read and write esf/1, the plain-text format for EVE Online ship fits. Text, canonical and binary forms. No dependencies.
Usage
use ;
save() and save_binary() take entries in any order, and check every rule
of the spec. load() returns fits in canonical form. All three return an
esf::Error when a rule is broken. It says where: line for text, or fit
and entry (counting from 1) for fits.
Fits
An EsfFit is one fit: hull, name, tactical mode and its entries.
hull is None for a fit without a ship. A document can hold more than one
fit.
Each Entry is one line of the fit. None means the default:
| field | what it is | None means |
|---|---|---|
type_id |
The type ID. | An empty slot. |
count |
How many. | One; for fighters, a full squadron. |
fit_name |
The name of another fit in the list, which this ship or container carries. | Carries no fit. |
charge |
The charge loaded. | |
charge_count |
How many charges. | A full load. |
mutaplasmid |
The mutaplasmid applied. | |
overrides |
Attribute values by attribute ID. | |
state |
State::Off, On or Heat. |
Active if the type can be, else on. |
location |
Cargo, Bay or another hold; a rack only for an empty slot. |
Where the type goes by default. |
The Catalog
The library holds no game data. You give it a Catalog: a type that looks
up types and attributes in your copy of the SDE.
use ;
;
Names are looked up folded: index them with esf::fold(name). Where names
are shared, published wins, then the lowest ID (§4.2).
tests/catalog/mod.rs
is a complete example.
Tests
The test cases live in esf-format: