Initial Commit
This commit is contained in:
52
MapShuffler/README.md
Normal file
52
MapShuffler/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# MapShuffler
|
||||
|
||||
Small console utility to enumerate `.bsp` map files from a directory, shuffle their order, and write the shuffled list to a text file.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- .NET 10 SDK (the project targets `net10.0`).
|
||||
|
||||
## Build
|
||||
|
||||
From the repository root run:
|
||||
|
||||
```bash
|
||||
dotnet build MapShuffler/MapShuffler.csproj
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Syntax:
|
||||
|
||||
```bash
|
||||
dotnet run --project MapShuffler -- <output.txt> <maps_directory>
|
||||
```
|
||||
|
||||
- `<output.txt>`: path to the output text file that will be (over)written.
|
||||
- `<maps_directory>`: directory containing `.bsp` files (top-level only).
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
dotnet run --project MapShuffler -- shuffled_maps.txt /home/user/maps
|
||||
```
|
||||
|
||||
Behavior notes:
|
||||
|
||||
- The program searches the provided directory (non-recursively) for files with the `.bsp` extension (case-insensitive).
|
||||
- Output contains one entry per line: the map filename with the `.bsp` extension removed.
|
||||
- The list is shuffled using a Fisher–Yates shuffle and written in UTF-8.
|
||||
- If there are no `.bsp` files found the program will write an empty file at the specified output path.
|
||||
- The program will create the parent directory for the output file if it does not exist.
|
||||
- Existing output files are overwritten.
|
||||
|
||||
Exit codes:
|
||||
|
||||
- `0` — success
|
||||
- `1` — incorrect arguments
|
||||
- `2` — input directory not found
|
||||
- `99` — unexpected error
|
||||
|
||||
See the implementation in [MapShuffler/Program.cs](MapShuffler/Program.cs#L1).
|
||||
|
||||
If you'd like different behavior (recursive search, full paths in output, interactive prompts, or one-file-per-map), tell me and I can update the tool.
|
||||
Reference in New Issue
Block a user