Files
ClassicAssist.Avalonia/.qoder/repowiki/en/content/Advanced Features/Agent Framework/Dress Manager Agent.md
T
Beyhan Oğur d5f52cc3d3 first commit
2026-09-03 04:45:36 +03:00

19 KiB

Dress Manager Agent

**Referenced Files in This Document** - [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs) - [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs) - [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs) - [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs) - [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs) - [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs) - [DressTabControl.xaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml) - [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)

Table of Contents

  1. Introduction
  2. Project Structure
  3. Core Components
  4. Architecture Overview
  5. Detailed Component Analysis
  6. Dependency Analysis
  7. Performance Considerations
  8. Troubleshooting Guide
  9. Conclusion

Introduction

The Dress Manager agent is a sophisticated automation system within ClassicAssist that manages character equipment sets and automates outfit changes based on various game scenarios. This feature allows players to create multiple dress profiles containing specific equipment configurations for different activities such as combat, crafting, social events, or exploration. The system intelligently switches between these profiles automatically or manually, ensuring optimal gear setup for any situation.

The Dress Manager provides a comprehensive solution for managing complex equipment setups, handling item validation, conditional outfit switching, and seamless integration with game events and skill checks. It supports both manual profile selection and automatic detection-based outfit changes, making it an essential tool for efficient gameplay management.

Project Structure

The Dress Manager implementation follows a clean architecture pattern with clear separation between data models, business logic, user interface, and testing components:

graph TB
subgraph "Data Layer"
DM[DressManager.cs]
DAE[DressAgentEntry.cs]
DAI[DressAgentItem.cs]
DT[DressAgentItemType.cs]
end
subgraph "UI Layer"
VM[DressTabViewModel.cs]
XAML[DressTabControl.xaml]
CS[DressTabControl.xaml.cs]
end
subgraph "Testing"
TEST[DressAgentTests.cs]
end
subgraph "Game Integration"
GAME[Game Engine]
ITEMS[Item System]
EVENTS[Event System]
end
DM --> DAE
DM --> DAI
DM --> DT
VM --> DM
XAML --> VM
CS --> VM
DM --> GAME
DM --> ITEMS
DM --> EVENTS
TEST --> DM

Diagram sources

Section sources

Core Components

The Dress Manager system consists of several key components that work together to provide comprehensive equipment management functionality:

Data Models

The core data structures define how dress profiles and items are represented:

  • DressAgentEntry: Represents a complete dress profile containing all equipment slots and their configurations
  • DressAgentItem: Defines individual item specifications including item type, properties, and slot assignments
  • DressAgentItemType: Enumerates all possible equipment types and categories supported by the system
  • DressManager: Central orchestrator managing profile creation, validation, and outfit application

User Interface Components

The UI layer provides intuitive management interfaces:

  • DressTabViewModel: Manages the view model state and business logic for the dress manager interface
  • DressTabControl: Main tab control hosting the dress manager functionality
  • XAML Layout: Declarative UI definitions for profile management, item selection, and preview features

Testing Framework

Comprehensive test coverage ensures reliability:

  • DressAgentTests: Unit tests covering profile creation, item validation, and outfit switching scenarios

Section sources

Architecture Overview

The Dress Manager follows a layered architecture pattern with clear separation of concerns:

sequenceDiagram
participant User as "User Interface"
participant ViewModel as "DressTabViewModel"
participant Manager as "DressManager"
participant GameEngine as "Game Engine"
participant ItemSystem as "Item System"
User->>ViewModel : Create New Profile
ViewModel->>Manager : AddProfile(profileName)
Manager->>Manager : ValidateProfile()
Manager-->>ViewModel : ProfileCreated
User->>ViewModel : Add Item to Slot
ViewModel->>Manager : AddItemToSlot(slotType, itemSpec)
Manager->>ItemSystem : ValidateItem(itemSpec)
ItemSystem-->>Manager : ValidationResult
Manager-->>ViewModel : ItemAdded
User->>ViewModel : Apply Outfit
ViewModel->>Manager : ApplyOutfit(profileId)
Manager->>GameEngine : EquipItems(items)
GameEngine-->>Manager : EquipmentStatus
Manager-->>ViewModel : OutfitApplied
Note over Manager,GameEngine : Automatic Detection
GameEngine->>Manager : OnCombatStart()
Manager->>Manager : FindBestOutfit(combat)
Manager->>GameEngine : AutoEquip(outfit)

Diagram sources

The architecture emphasizes:

  • Separation of Concerns: Clear boundaries between UI, business logic, and game integration
  • Validation at Multiple Levels: Item validation occurs during both configuration and application
  • Event-Driven Updates: Real-time synchronization between game state and UI
  • Error Handling: Comprehensive error management for missing items and invalid configurations

Detailed Component Analysis

Dress Manager Core Logic

The DressManager serves as the central coordinator for all dress-related operations:

Key Responsibilities

  • Profile lifecycle management (creation, modification, deletion)
  • Item validation and compatibility checking
  • Outfit application and rollback mechanisms
  • Conditional outfit switching based on game context
  • Performance optimization for large inventories

Data Flow Architecture

flowchart TD
Start([Profile Creation]) --> ValidateInput["Validate Profile Input"]
ValidateInput --> InputValid{"Input Valid?"}
InputValid --> |No| ShowError["Display Validation Error"]
InputValid --> |Yes| CreateProfile["Create Empty Profile"]
CreateProfile --> AddItems["Add Items to Slots"]
AddItems --> ValidateItems["Validate All Items"]
ValidateItems --> ItemsValid{"All Items Valid?"}
ItemsValid --> |No| FixItems["Guide User to Fix Issues"]
ItemsValid --> |Yes| SaveProfile["Save Profile Configuration"]
SaveProfile --> ReadyForUse["Profile Ready for Use"]
ReadyForUse --> ManualSwitch["Manual Profile Switch"]
ReadyForUse --> AutoSwitch["Automatic Context Switch"]
ManualSwitch --> ApplyOutfit["Apply Selected Outfit"]
AutoSwitch --> DetectContext["Detect Game Context"]
DetectContext --> SelectBest["Select Best Matching Outfit"]
SelectBest --> ApplyOutfit
ApplyOutfit --> ValidateEquippable["Validate Equippable Items"]
ValidateEquippable --> EquipSuccess{"Equipment Success?"}
EquipSuccess --> |No| HandleErrors["Handle Missing/Invalid Items"]
EquipSuccess --> |Yes| UpdateUI["Update UI State"]
HandleErrors --> LogErrors["Log Errors and Warnings"]
LogErrors --> PartialSuccess["Report Partial Success"]
UpdateUI --> Complete([Operation Complete])
PartialSuccess --> Complete

Diagram sources

Conditional Outfit Switching Logic

The system supports sophisticated conditional logic for automatic outfit changes:

stateDiagram-v2
[*] --> Idle
Idle --> CombatDetected : "Enter Combat"
Idle --> CraftingDetected : "Start Crafting"
Idle --> SocialDetected : "Enter Social Area"
Idle --> ExplorationDetected : "Begin Exploration"
CombatDetected --> EvaluateCombatGear["Evaluate Combat Gear"]
CraftingDetected --> EvaluateCraftingGear["Evaluate Crafting Gear"]
SocialDetected --> EvaluateSocialGear["Evaluate Social Gear"]
ExplorationDetected --> EvaluateExplorationGear["Evaluate Exploration Gear"]
EvaluateCombatGear --> HasBetterGear{"Has Better Combat Gear?"}
EvaluateCraftingGear --> HasBetterCrafting{"Has Better Crafting Gear?"}
EvaluateSocialGear --> HasBetterSocial{"Has Better Social Gear?"}
EvaluateExplorationGear --> HasBetterExploration{"Has Better Exploration Gear?"}
HasBetterGear --> |Yes| SwitchToCombat["Switch to Combat Outfit"]
HasBetterCrafting --> |Yes| SwitchToCrafting["Switch to Crafting Outfit"]
HasBetterSocial --> |Yes| SwitchToSocial["Switch to Social Outfit"]
HasBetterExploration --> |Yes| SwitchToExploration["Switch to Exploration Outfit"]
HasBetterGear --> |No| StayCurrent["Stay Current Outfit"]
HasBetterCrafting --> |No| StayCurrent
HasBetterSocial --> |No| StayCurrent
HasBetterExploration --> |No| StayCurrent
SwitchToCombat --> Idle
SwitchToCrafting --> Idle
SwitchToSocial --> Idle
SwitchToExploration --> Idle
StayCurrent --> Idle

Diagram sources

Item Slot Mapping System

The dress system uses a comprehensive slot mapping mechanism to ensure proper equipment placement:

Supported Equipment Slots

  • Head, Neck, Ear, Face, Hair, Beard
  • Chest, Arms, Hands, Legs, Feet
  • Waist, Ring Left, Ring Right
  • Weapon, Shield, Secondary Weapon
  • Clothing layers and special equipment slots

Slot Compatibility Rules

  • Armor type restrictions (light, medium, heavy)
  • Race and gender compatibility checks
  • Skill requirement validation
  • Stat minimum requirements
  • Faction and reputation restrictions

Profile Management Features

Profile Creation Workflow

  1. Template Selection: Choose from predefined templates or start from scratch
  2. Item Assignment: Drag-and-drop items into appropriate slots
  3. Conditional Rules: Set up automatic switching conditions
  4. Priority Settings: Configure profile priority for conflict resolution
  5. Validation: Comprehensive validation before saving

Advanced Profile Features

  • Nested Profiles: Reference other profiles for component reuse
  • Dynamic Items: Items that change based on current game state
  • Fallback Mechanisms: Graceful degradation when preferred items unavailable
  • Export/Import: Share profiles between characters or accounts

Section sources

User Interface Implementation

The UI provides an intuitive interface for managing dress profiles:

Main Interface Components

  • Profile List: Hierarchical display of all created profiles
  • Item Grid: Visual representation of equipment slots with drag-and-drop support
  • Preview Panel: Live preview of current and target outfits
  • Condition Editor: Visual editor for automatic switching rules
  • Validation Status: Real-time feedback on profile validity

Interactive Features

  • Drag-and-Drop: Intuitive item assignment to equipment slots
  • Live Preview: Immediate visual feedback when modifying profiles
  • Bulk Operations: Copy, paste, and batch modify multiple items
  • Search and Filter: Quick location of specific items across inventory
  • Keyboard Shortcuts: Efficient workflow for power users

Section sources

Dependency Analysis

The Dress Manager has well-defined dependencies on core game systems:

graph LR
subgraph "External Dependencies"
GE[Game Engine]
IS[Item System]
ES[Event System]
PM[Player Manager]
IM[Inventory Manager]
end
subgraph "Internal Dependencies"
DM[DressManager]
DAE[DressAgentEntry]
DAI[DressAgentItem]
DT[DressAgentItemType]
VM[DressTabViewModel]
end
DM --> GE
DM --> IS
DM --> ES
DM --> PM
DM --> IM
VM --> DM
DAE --> DAI
DAE --> DT
DAI --> DT
GE --> IS
ES --> GE
PM --> IS
IM --> IS

Diagram sources

Integration Points

Game Event Integration

  • Combat State Changes: Automatic outfit switching on combat entry/exit
  • Skill Activation: Equipment adjustments for specific skills
  • Location-Based Triggers: Outfit changes in specific areas or dungeons
  • Time-Based Conditions: Different outfits for day/night cycles

Player State Monitoring

  • Stat Changes: Dynamic equipment adjustment based on stat improvements
  • Level Progression: Automatic updates when new equipment becomes available
  • Quest Progress: Context-aware outfit recommendations based on active quests

Section sources

Performance Considerations

The Dress Manager implements several optimizations to handle large inventories efficiently:

Memory Management

  • Lazy Loading: Items loaded on-demand rather than pre-loading entire inventories
  • Caching Strategy: Frequently accessed item data cached in memory
  • Garbage Collection Optimization: Minimize object creation during outfit switching

Processing Optimization

  • Batch Operations: Group multiple equipment changes into single transactions
  • Asynchronous Processing: Non-blocking operations for time-consuming tasks
  • Progressive Enhancement: Basic outfit applied immediately, enhancements loaded in background

Inventory Scaling

  • Indexed Searches: O(log n) item lookup using optimized data structures
  • Filter Pipelines: Efficient filtering of items by category, rarity, and requirements
  • Memory Pooling: Reuse of temporary objects during outfit validation

Error Handling and Recovery

  • Graceful Degradation: System continues functioning even if some items unavailable
  • Rollback Mechanisms: Automatic revert to previous state on errors
  • Diagnostic Logging: Comprehensive logging for troubleshooting performance issues

Troubleshooting Guide

Common Issues and Solutions

Missing Items

Problem: Items referenced in profiles not found in inventory Solution:

  • Verify item availability and ownership
  • Check for account-wide vs. character-specific items
  • Use fallback items in profile configuration

Equipment Conflicts

Problem: Multiple items trying to occupy same slot Solution:

  • Review slot assignment in profile configuration
  • Ensure proper item type matching
  • Use priority settings to resolve conflicts

Performance Issues

Problem: Slow outfit switching with large inventories Solution:

  • Enable lazy loading for infrequently used profiles
  • Optimize search filters in profile configuration
  • Consider splitting large profiles into smaller, focused sets

Automatic Switching Not Working

Problem: Outfits not changing automatically as expected Solution:

  • Verify condition rules are properly configured
  • Check event subscription status
  • Review priority settings between conflicting profiles

Debug Information

The system provides comprehensive debug output including:

  • Profile validation results with detailed error messages
  • Item compatibility analysis and failure reasons
  • Performance metrics for outfit switching operations
  • Event subscription status and trigger logs

Section sources

Conclusion

The Dress Manager agent represents a comprehensive solution for automated equipment management in ClassicAssist. Its modular architecture, robust validation system, and intuitive user interface make it an essential tool for players seeking to optimize their gameplay experience through intelligent outfit management.

Key strengths include:

  • Flexibility: Support for diverse equipment configurations and use cases
  • Reliability: Comprehensive error handling and validation mechanisms
  • Performance: Optimized for large inventories and frequent outfit changes
  • Usability: Intuitive interface with powerful advanced features

The system's extensible design allows for future enhancements while maintaining backward compatibility, ensuring long-term value for users. Whether managing simple daily wear or complex combat loadouts, the Dress Manager provides the foundation for sophisticated character customization and automation.