Update README.md files for components, systems, and yachtpit crates with detailed module descriptions, usage examples, and architecture overviews.

This commit is contained in:
geoffsee
2025-07-03 12:11:31 -04:00
parent 3f694f4494
commit 7a23e55894
3 changed files with 157 additions and 10 deletions

View File

@@ -1,8 +1,66 @@
# yachtpit/crates/components
Provides components and rendering utilities for yachtpit.
# YachtPit Components Crate
The `components` crate provides reusable UI components and maritime instrument widgets for the YachtPit virtual yacht cockpit application.
## Overview
The `components` crate contains components and rendering primitives built on top of Bevy's engine.
This crate contains all the visual components and rendering primitives built on top of Bevy's UI system. It provides a comprehensive set of maritime instruments and displays that simulate real yacht cockpit equipment.
## Available Components
### Maritime Instruments
- **`SpeedGauge`** - Displays vessel speed in knots with analog gauge visualization
- **`DepthGauge`** - Shows water depth measurements with sonar-style display
- **`CompassGauge`** - Magnetic compass with heading display and cardinal directions
- **`WindDisplay`** - Wind speed and direction indicator with graphical representation
### Engine & Systems
- **`EngineStatus`** - Engine monitoring display showing RPM, temperature, and status
- **`SystemDisplay`** - General system status and monitoring interface
### Navigation Equipment
- **`NavigationDisplay`** - Chart plotter and navigation information display
- **`GpsIndicator`** - GPS status and position information
- **`RadarIndicator`** - Radar system status and basic display
- **`AisIndicator`** - AIS (Automatic Identification System) status and nearby vessels
### Core Components
- **`InstrumentCluster`** - Container for organizing multiple instruments
- **`VesselData`** - Data structures for vessel state and measurements
### UI Framework
- **`ui`** - Base UI utilities and common interface elements
- **`theme`** - Consistent theming and styling for maritime aesthetics
- **`composition`** - Layout and composition utilities for instrument arrangements
## Features
- **Realistic Maritime Aesthetics** - Components designed to mimic real yacht instruments
- **Bevy Integration** - Built on Bevy's ECS architecture for performance
- **Modular Design** - Each component can be used independently or combined
- **Responsive Layout** - Adapts to different screen sizes and orientations
- **Theme Consistency** - Unified visual design across all components
## Usage
This crate is designed to be used internally within the yachtpit project and is not published to crates.io. It exports foundational components used by the `systems` and `yachtpit` crates.
This crate is designed for internal use within the YachtPit project and is not published to crates.io. Components are imported and used by the `systems` and main `yachtpit` crates.
```rust
use components::{
SpeedGauge, DepthGauge, CompassGauge,
InstrumentCluster, VesselData
};
```
## Dependencies
- **Bevy 0.16** - Core engine and UI framework
- Built for cross-platform compatibility (Desktop, Web, Mobile)
## Architecture
Components follow Bevy's ECS (Entity-Component-System) pattern and are designed to be:
- **Composable** - Can be combined in different arrangements
- **Data-driven** - Respond to changes in vessel data automatically
- **Performance-oriented** - Optimized for real-time updates
- **Platform-agnostic** - Work across all supported platforms

View File

@@ -1,9 +1,98 @@
# yachtpit/crates/systems
This crate provides Bevy-based systems and logic for yachtpit.
# YachtPit Systems Crate
The `systems` crate provides the core game systems, vessel logic, and maritime system integrations for the YachtPit virtual yacht cockpit application.
## Overview
The `systems` crate contains the core systems and logic built on top of Bevy's engine.
It depends on the `components` crate and extends it with domain-specific systems, behaviors, and randomization utilities.
This crate contains all the business logic and system implementations built on top of Bevy's ECS (Entity-Component-System) architecture. It bridges the visual components with real maritime system behaviors, data processing, and vessel simulation logic.
## System Modules
### World Management
- **`world::player`** - Player entity management and vessel ownership
- `PlayerPlugin` - Bevy plugin for player system integration
- `get_vessel_systems()` - Retrieves available vessel systems
- `setup_instrument_cluster_system()` - Initializes instrument displays
### Vessel Systems
- **`vessel::vessel_systems`** - Core vessel system implementations
- `VesselSystem` - Base trait for all vessel systems
- `SystemStatus` - System operational status tracking
- `SystemInteraction` - User interaction handling
- `create_vessel_systems()` - Factory for vessel system creation
### Maritime Systems
- **`AisSystem`** - Automatic Identification System integration
- Vessel tracking and identification
- Collision avoidance data
- Maritime traffic monitoring
- **`GpsSystem`** - Global Positioning System implementation
- Position tracking and navigation
- Waypoint management
- Course and speed calculations
- **`RadarSystem`** - Radar detection and display system
- Object detection and tracking
- Range and bearing calculations
- Weather and obstacle detection
## Key Features
### System Integration
- **Real-time Data Processing** - Continuous updates of vessel and environmental data
- **System Interconnectivity** - Maritime systems work together for comprehensive navigation
- **Status Monitoring** - Track operational status of all vessel systems
- **User Interaction** - Handle user inputs and system controls
### Vessel Simulation
- **Realistic Behavior** - Systems behave like real maritime equipment
- **Data Validation** - Ensure data integrity and realistic ranges
- **System Dependencies** - Model real-world system interdependencies
- **Performance Optimization** - Efficient processing for real-time operation
### Plugin Architecture
- **Modular Design** - Each system can be enabled/disabled independently
- **Bevy Integration** - Full integration with Bevy's plugin system
- **Event-Driven** - Responsive to system events and state changes
- **Extensible** - Easy to add new maritime systems
## Usage
This crate is designed to be used internally within the yachtpit project and is not published to crates.io. It provides the game systems layer that bridges the foundational components with the main application logic.
This crate is designed for internal use within the YachtPit project and is not published to crates.io. It provides the systems layer that connects components with application logic.
```rust
use systems::{
PlayerPlugin, VesselSystem, SystemStatus,
AisSystem, GpsSystem, RadarSystem,
create_vessel_systems, get_vessel_systems
};
```
## Dependencies
- **Bevy 0.16** - Core ECS engine and plugin system
- **`components`** - UI components and instrument widgets
- **Rust Standard Library** - Core functionality and data structures
## Architecture
The systems crate follows these design principles:
### ECS Integration
- **Systems** - Process vessel data and update component states
- **Components** - Store vessel and system state data
- **Resources** - Manage shared data like vessel configuration
- **Events** - Handle system interactions and state changes
### Data Flow
1. **Input Processing** - Handle user interactions and external data
2. **System Updates** - Process maritime system logic and calculations
3. **Component Updates** - Update visual components with new data
4. **Event Dispatch** - Notify other systems of state changes
### Performance Considerations
- **Efficient Queries** - Optimized ECS queries for real-time performance
- **Batch Processing** - Group similar operations for better performance
- **Memory Management** - Careful resource management for smooth operation
- **Platform Optimization** - Optimized for desktop, web, and mobile platforms

View File

@@ -2,7 +2,7 @@
This is the main application crate for yachtpit.
## Overview
The `yachtpit` crate unifies components and systems into an application.
The `yachtpit` crate unifies components and systems into an application.
It supports several runtimes to include web, desktop, and mobile platforms.
## Usage