Commit Graph
130 Commits
Author SHA1 Message Date
GarandPLG 305cc2c4a2 Merge pull request 'Test packaging' (#2) from test_packaging into main
Linux package builds (test) / aur (push) Successful in 5m50s
Rust checks / check (push) Successful in 2m38s
Nix package / build (push) Successful in 7m43s
Linux package builds (test) / linux (push) Failing after 22s
Reviewed-on: #2
2026-10-19 15:56:30 +02:00
GarandPLG 276646d011 Add Node.js to Arch CI dependencies
Rust checks / check (push) Successful in 2m37s
Nix package / build (push) Successful in 6m38s
Linux package builds (test) / linux (push) Successful in 2m16s
Linux package builds (test) / aur (push) Successful in 6m3s
Nix package / build (pull_request) Successful in 7m51s
Linux package builds (test) / linux (pull_request) Successful in 2m15s
Linux package builds (test) / aur (pull_request) Successful in 6m15s
Rust checks / check (pull_request) Successful in 2m53s
Install nodejs in the Arch build container and verify its version
Update docs to note Node.js as a CI dependency for the AUR job
2026-10-19 15:25:25 +02:00
GarandPLG c3dbfe435a Add Linux packaging workflow and related scripts
Nix package / build (push) Successful in 7m20s
Linux package builds (test) / linux (push) Successful in 3m17s
Linux package builds (test) / aur (push) Failing after 1m2s
Rust checks / check (push) Successful in 2m42s
Introduce a new CI workflow `.gitea/workflows/packages.yml` that builds
deb, rpm, AppImage, Flatpak and AUR packages on push and PR events.
Add packaging helpers (`build.sh`, `stage.sh`, spec file, PKGBUILD,
desktop entry, SVG icon) and supporting assets under `packaging/`.
Update `.gitignore` to ignore the generated `dist` directory.
Expand documentation (CODE_MAP, AGENTS, PROGRESS, TESTING and new
PACKAGING.md) to describe the packaging process and its limitations.
Adjust `src/app/threads/audio.rs` and `tests/audio.rs` imports to
support loading audio files from installed package layouts.
2026-10-19 15:04:36 +02:00
GarandPLG 8ee037ccef Add Nix CI workflow, update docs and cargo hash
Nix package / build (push) Successful in 7m26s
Rust checks / check (push) Successful in 2m36s
2026-10-19 14:32:42 +02:00
GarandPLG 40dd03ed62 Remove Nix from CI, use rustup with caching
Rust checks / check (push) Successful in 5m29s
Install required system packages and set RUST_VERSION=1.99.1. Cache the
Rust
toolchain and Cargo registry, and run Cargo commands directly instead of
via
`nix develop`. Documentation files are updated to reflect the new
workflow.
2026-10-19 14:12:07 +02:00
GarandPLG a94e36f646 Fix CI Nix installation and adopt MIT license
Rust checks / check (push) Successful in 11m24s
- Run CI jobs in `node:22-bookworm` container, install sudo and disable
  KVM for the Nix installer.
- Replace CC0 with the MIT license and add `license = "MIT"` to
  Cargo.toml.
- Update README and documentation (CODE_MAP, PROGRESS, TESTING) to
  reflect the new license and CI changes.
2026-10-19 13:00:56 +02:00
GarandPLG dfe46cab96 Add CI workflow and enforce Rust 1.88 linting
Rust checks / check (push) Failing after 1m7s
2026-10-19 12:33:06 +02:00
GarandPLG c4313b4117 Add rustfmt configuration and reformat code
- Document new Rust formatting standards in AGENTS, CODE_MAP, and
  PROGRESS.
- Add rustfmt.toml with style 2024, 2‑space indents, 100‑char width, LF
  endings.
- Apply consistent 2‑space indentation and ordering across source files.
- Minor clean‑up of imports and whitespace to match the new style.
2026-10-19 12:21:20 +02:00
GarandPLG 9e09aaf75e Add MovingTask and progress tracking
Introduce a new MovingTask type for movement segments and extend
the Tasks enum
to include it.  Add total‑step tracking and a get_total_progress default
in the
Task trait, and implement the corresponding methods for MovingTask.
Update
units to allow coordinate changes via set_coords, add stone damage
handling,
and adjust board advancement logic to use the new task system.  Update
UI
code to display step and total percentages in the Tab panel.  Expand
documentation (README, AGENTS, CODE_MAP, PROGRESS, TESTING) to describe
digging
and moving, and add extensive tests (including tests/digging.rs) for the
new
behaviour.
2026-10-18 21:21:00 +02:00
GarandPLG fcdbbaf74c Add tests, fix offset logic, and bump dependencies
- Introduce a comprehensive test suite (cli, app, board, tasks, audio)
  and a
  new TESTING.md document describing test execution.
- Correct vertical offset calculation in `BoardState` to use saturating
  subtraction and ceiling division.
- Clamp initial `Offset` values to the provided maximum in
  `Offset::new`.
- Export `load_audio` from the audio thread module and switch to
  `LoopedDecoder` for proper OGG looping.
- Update several crate versions: clap, ratatui, log, rodio, and
  bitflags.
2026-10-18 20:29:04 +02:00
GarandPLG 9bc42dc898 Add project documentation and update flake.lock
Introduce AGENTS.md as an entry point for agents, add CODE_MAP.md with a
module overview and diagrams, and create PROGRESS.md to log work
progress.
Update flake.lock to reflect dependency revisions.
2026-10-18 20:08:11 +02:00
GarandPLG a7aa72ba95 Add detailed War in Tunnels README 2026-06-02 15:16:47 +02:00
GarandPLG 57df985112 Refactor skirmish tasks and update dependencies
- Disable automatic board.advance_turn and replace it with explicit unit
  movement handling.
- Add Tunnel structure creation during digging tasks.
- Extend DiggingTask with pop_front and current_target helpers.
- Rename task getters to get_ref_tasks and add mutable get_mut_tasks.
- Update Unit trait and Units enum to expose these new methods.
- Remove unused EMPTY_TASKS lazy static.
- Bump flake.lock revisions, hashes, and timestamps for several
  dependencies.
2026-06-02 15:07:55 +02:00
GarandPLG 00eeb97ed8 Add progress tracking to tasks and turn advancement
- Extend the `Task` trait with methods for progress handling and
  completion.
- Update `DiggingTask` to store `progress` and `tick_increase`, and
  implement the new trait methods.
- Implement the new methods in the `Tasks` enum, adding a mutable
  accessor.
- Introduce `BoardState::get_active_tasks` and
  `BoardState::advance_turn` to iterate over active tasks and update
  their progress each turn.
- Un-comment the call to `board.advance_turn()` in
  `SkirmishState::tick_update`.
2026-05-20 12:49:18 +02:00
GarandPLG c3b76a7c2e Add short flags for CLI options; change map flags
Map width flag changed from -M to -W and height flag set to -H.
Added short flags: -w (wood), -i (iron), -L (supply limit),
-P (skill points), -m (mute soundtrack), -l (enable logging).
2026-05-20 11:43:28 +02:00
GarandPLG e3c3ad96e3 Add delete flag to end_marking_cells
Pass true when handling the Delete action and false for normal cleanup,
updating all call sites to use the new boolean parameter.
2026-05-19 13:24:33 +02:00
GarandPLG ec4c68364d Add two spaces after miner task icon 2026-05-19 01:01:29 +02:00
GarandPLG 5b960c65ff Rename marking methods and use get_coords
Introduce push_marked_cell, pop_marked_cell and end_marking_cells to
replace the
previous set_marked_cell, undo_marked_cell and clear_marked_cells.
Collapse
get_row/get_col into get_coords and update all callers accordingly.
2026-05-19 00:59:48 +02:00
GarandPLG 34c5e448ce . 2026-05-18 17:37:31 +02:00
GarandPLG 291670fad3 Return task queue as styled Line vectors
Change `get_tasks_formatted` to return a `Vec<Line<'_>>` instead of a
plain
`String`. Update `MinerUnit` to construct colored task lines, modify the
`Unit` trait and `Units` implementations to use the new return type, and
add the required `ratatui` imports. Adjust `base_text` handling to
render
each task line separately.
2026-05-18 16:02:12 +02:00
GarandPLG d2f5968861 Add Task trait and improve miner task display
Define a full `Task` trait with icon and path accessors. Implement the
trait for
`DiggingTask` and delegate it through the `Tasks` enum. Introduce helper
functions in `MinerUnit` to convert coordinates to spreadsheet‑style
strings
and use them in a revamped `get_tasks_formatted`. Update the unit
rendering
logic to show the tasks queue only when tasks are present.
2026-05-18 15:48:40 +02:00
GarandPLG 7c9e3d28f0 Refactor task handling to use VecDeque references
- Change `get_tasks` to return `&VecDeque<Tasks>` instead of a formatted
  `String`.
- Introduce `get_tasks_formatted` for display purposes.
- Update `MinerUnit`, `Unit` trait, `Units` enum, and its `Option`
  implementation accordingly.
- Add `EMPTY_TASKS` lazy static for handling empty task lists.
- Adjust `BoardState` to use the new task API (commented out
  conditional).
2026-05-18 14:48:07 +02:00
GarandPLG e4728aab5d Show unit task queue and mark in side panel
Add `get_tasks` to the `Unit` trait and implement it for `MinerUnit`,
`Units` enum and `Option<Units>`.  Use the new method in `base_text` to
display a “Tasks Queue” line.

Refactor task assignment in `BoardState` to a chained call.

Update the skirmish view and `SidePanelWidget` to pass a flag indicating
whether the displayed unit is the currently marked one, and highlight
the
unit name accordingly.
2026-05-17 11:00:06 +02:00
GarandPLG a7d8823bf2 Add short options to CLI arguments 2026-05-12 13:48:43 +02:00
GarandPLG f554fa2efc Add digging tasks and unit coordinate support
Introduce Tasks handling for units, store coordinates in MinerUnit,
expose getters/setters for unit tasks, add logging of marked cells,
and provide cell accessors for mutable unit options.
2026-05-12 13:42:13 +02:00
GarandPLG a3bb9dc6f1 Remove unused base coordinates from BoardState 2026-05-12 10:51:18 +02:00
GarandPLG d87316e4fe Remove unused lifetimes from app structs 2026-05-12 10:48:48 +02:00
GarandPLG 19f4417172 Add calm soundtrack and fix loading path 2026-05-12 10:38:01 +02:00
GarandPLG cd1822d05e Add lifetime parameter and MarkedCells struct
Refactor App, GameStates, SkirmishState and BoardState to carry a
generic
lifetime `'a`. Introduce a new `MarkedCells` type that holds marking
state
and selected unit, replacing the previous `marking_cells` flag and raw
deque. Update related methods, keybindings, view implementations and
module exports to use the new structures.
2026-05-06 21:39:53 +02:00
GarandPLG b66c1d8e25 Use VecDeque for tasks and marked cells
Replace `Vec` with `VecDeque` in `BoardState` marked cells,
`DiggingTask` path,
and `MinerUnit` tasks to enable efficient push/pop operations. Remove
the
`Copy` trait from several structs and enums, adjust derives accordingly,
and
use `as_ref` in `Option<Units>` implementations to avoid consuming the
option.
Update cell rendering to clone widgets and adjust
`CellWidget::get_option_unit`
to return a cloned `Option<Units>`. Add necessary `VecDeque` imports.
2026-05-06 20:01:49 +02:00
GarandPLG 41020708e4 Rename internal helpers and adjust related calls
Rename `structure` to `s` in Structures and `unit` to `u` in Units,
updating all
call sites. Refactor `Structures::text` to match on the owner directly
and
push the owner line only for claimed owners. Change the “% )” token
color
in unit display from green to gray.
2026-05-06 18:51:45 +02:00
GarandPLG 644d8648b2 Refactor DiggingTask and embed it in Tasks enum
- Remove lifetime and path storage from DiggingTask, make it Copy.
- Add a placeholder `new` constructor that accepts a path.
- Update the Tasks enum to hold a DiggingTask value.
- Reorder module declarations and re‑export order for tasks.
- Add a commented‑out tasks field to MinerUnit as a preparation step.
2026-05-05 17:43:50 +02:00
GarandPLG 1c0f27f115 Add tasks module and rename trait files 2026-05-05 17:14:33 +02:00
GarandPLG a1d0a84885 Add Miner stats and conditional audio flag
- Extend MinerUnit with hp, digging ability, and power, and provide
  getters for these fields.
- Update the Unit trait and Units enum to expose hp, max hp,
  can_dig, and digging_power, and enhance base_text to display them.
- Remove unnecessary `Eq` derives from several structs and enums.
- Introduce a `--disable-audio` CLI flag and conditionally spawn the
  audio thread based on its value.
2026-05-05 16:58:29 +02:00
GarandPLG 35209dd064 Expose tick interval constant and simplify handler
Move the 33 ms tick interval into `tick` as a public constant `TICK_MS`
and drop the parameter from `handle_tick_event`.
Update re‑exports and callers accordingly
2026-05-05 13:58:17 +02:00
GarandPLG b1183175be Display structure owner and adjust UI layouts
Add owner line to structure text, using gray label and owner span.
Switch side panel layout to Fill/Length and remove left border from side
panel widget.
Import Stylize for colored text rendering.
2026-05-05 13:34:07 +02:00
GarandPLG 55a260755c Add ore level support and unify text rendering
Introduce a numeric `level` field for `BaseBuilding` and `Ore`, update
their
constructors and `get_level` implementations, and increase the default
ore
amount to the new maximum. Extend the `Structure` and `Unit` traits with
`base_text` and `text` methods, add `is_unit` to `Units`, and adjust the
`Structures` enum to delegate text rendering. Refactor `SidePanelWidget`
to
use the unified trait methods, removing duplicated rendering code.
Update
`BoardState` to create ore structures with an initial level of 1.
2026-05-05 00:18:49 +02:00
GarandPLG 766b65b2fc Introduce Ore structure and simplify durability fields
Add a new Ore structure with ownership, amount, and durability, and
extend the
Structures enum to include it. Update board generation to place ore
cells next
to player and enemy bases and adjust base coordinates accordingly.
Remove the
redundant `max_durability` field from BaseBuilding, Stone, and Tunnel,
fixing
their `get_max_durability` implementations to return constant values.
Rename the
tick handling parameter from `interval_ms` to `tick_ms`. Minor clean‑ups
include
re‑exporting the Ore module, adding TODO comments in the side panel
widget, and
simplifying the audio thread spawn in `main.rs`.
2026-05-04 16:14:54 +02:00
GarandPLG 1daa9802ed Remove AppChannels, use separate receivers
Refactor App::run to accept individual Receiver arguments instead of an
AppChannels struct. Delete the AppChannels definition and its re‑export,
and update main.rs to create each channel manually and pass the
receivers
to App::run. Rename the CLI field `sound_track` to `soundtrack` and
adjust
all references. Clean up imports and formatting accordingly.
2026-05-04 10:35:09 +02:00
GarandPLG 5b03f54efb Drop JoinHandle variables and thread joins
Thread handles are no longer kept; spawn threads directly and omit the
join calls. The unused `JoinHandle` import and related comments are
removed.
2026-05-03 22:37:47 +02:00
GarandPLG e4705fa32a Merge pull request 'Add tick thread and Skirmish state update' (#1) from todo_gameplayloop into main
Reviewed-on: #1
2026-05-03 20:28:32 +00:00
GarandPLG 7541db79d8 Refactor App to use unified AppChannels for events
App now receives an AppChannels struct; AppEvent enum removed.

Event handling, tick generation, and audio communication are now
performed through dedicated channels.
2026-05-03 22:27:08 +02:00
GarandPLG 7fb001faab Add tick thread and Skirmish state update
Introduce `AppEvent::Tick` and a background thread that emits timed
events. `App` now handles `Tick` by calling a new `update` method,
which advances the board and increments a `turn_counter` in
`SkirmishState`. Add required imports, fields, and the
`spawn_tick_thread` call in `main`.
2026-05-03 18:14:46 +02:00
GarandPLG b639531841 Refactor GameMode and Players into skirmish_states
Move the GameMode and Players enums from the top‑level states module
into the
skirmish_states submodule, add an Unclaimed variant to Players, and
update all
imports, trait implementations, and related logic accordingly. Adjust
the
durability percentage calculation to use u32 for safety.
2026-05-01 19:05:03 +02:00
GarandPLG f7c1795f29 Add max durability and enhance side panel UI
- Introduce `max_durability` fields to BaseBuilding, Stone, and Tunnel
  structures.
- Extend `Structure` trait with `get_max_durability` and implement it in
  all structures.
- Update `Structures` enum to forward `get_max_durability`.
- Add color utilities and `get_span` method to `Players` enum for styled
  text.
- Refactor `CellWidget` method names (`get_option_unit`,
  `set_structure`).
- Revise side panel widget to accept references to `Structures` and
  `Option<Units>`, render colored blocks and detailed stats.
- Simplify skirmish view to use `BoardState` directly and adapt side
  panel rendering.
2026-04-26 21:04:19 +02:00
GarandPLG c24862dd48 Extract helper methods for enum trait implementations 2026-04-24 11:53:07 +02:00
GarandPLG cf843057c3 Add side panel and refactor title helpers
Introduce a `side_panel` flag throughout the skirmish state, board
creation,
and cell area calculation to enable a detachable side panel. Refactor
the
title helper to own its strings and use a static separator, updating the
single‑title helper accordingly. Add a new `SidePanelWidget` and expose
the
`skirmish_main_area_layout` helper. Extend keybindings with `Tab` and
`ShiftTab` actions under a new `Opener` group. Update structures and
units
to implement a `get_name` method and adjust related traits and imports.
2026-04-24 11:41:09 +02:00
GarandPLG 06a439ff88 Move ZoomLevel into skirmish_states
Introduce Structure and Unit traits with enum wrappers.
Replace old zoom helper with ZoomLevel methods.
Update imports, BoardState, CellWidget, and CLI to use new locations.
2026-04-20 12:17:56 +02:00
GarandPLG a04264c08b Remove selected check in CellWidget::get_color 2026-04-19 20:06:11 +02:00
GarandPLG 0a8b3562f6 Rename buildings module to structures 2026-04-19 20:02:21 +02:00