inf2ron 0.2.2

Parse Stranded II .inf definition files (items, objects, units, buildings, combinations) and output RON format
Documentation
# inf2ron

**Parse Stranded II `.inf` definition files and output RON format.**

Part of the [OpenStranded](https://github.com/OpenStranded/s2mod-tool)
toolchain for converting original game mods into `.s2mod` Content Packs.

[Documentation](https://docs.rs/inf2ron) |
[Crate](https://crates.io/crates/inf2ron)

## Usage

### CLI

```text
inf2ron <file.inf>... [output]
```

- `<file.inf>...` — one or more `.inf` files to parse
- `[output]` — optional output directory (default: current directory)

Each `.inf` file produces a corresponding `.ron` file with the same base name.

#### Example

```sh
inf2ron items_edible.inf items_material.inf
# produces ./items_edible.ron and ./items_material.ron

inf2ron objects_trees.inf objects_rocks.inf output/
# produces output/objects_trees.ron and output/objects_rocks.ron
```

### Library

```toml
[dependencies]
inf2ron = "0.1"
```

```rust
use inf2ron::{InfParser, InfEntry};

let entries = InfParser::parse_str(r#"
id=9
name=Meat
group=food
icon=gfx\meat.bmp
model=gfx\meat.b3d
weight=500
"#)?;
```

### Modules

| Module      | Description                          |
|-------------|--------------------------------------|
| `parser`    | State-machine `.inf` parser          |
| `types`     | Data types: `InfEntry`, `CombiBlock` |
| `registry`  | Typed domain structures + classifier |
| `error`     | Error types                          |
| `cli`       | Command-line interface               |

## `.inf` file format

Line-oriented key=value with multi-line blocks:

```ini
### Entity name
id=9
name=Meat
group=food
icon=gfx\meat.bmp
model=gfx\meat.b3d
weight=500
script=start
    on:eat {
        eat 5,20,10,0;
    }
script=end
```

Comments: `#` line, `//` line within script blocks.
Multi-value keys supported (e.g. multiple `req=` in crafting recipes).

## License

GPL-3.0-or-later. See [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).