1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! Generic research/development/learning management plugin
//!
//! This plugin provides research progression for strategy, RPG, simulation, and crafting games.
//!
//! # Features
//!
//! - **Generic & Extensible**: No hard-coded game mechanics (technology, skills, recipes)
//! - **Hook-based Customization**: Game-specific logic via hooks
//! - **Event-driven**: Command events + State events for network replication
//! - **Flexible Queue Management**: Single-queue or parallel research
//! - **Multiple Progress Models**: Turn-based, time-based, or manual progress
//!
//! # Use Cases
//!
//! - **Strategy games**: Technology research, military R&D
//! - **RPG**: Skill learning, spell research, crafting recipes
//! - **Simulation**: Product development, business R&D
//! - **Crafting**: Recipe discovery, material synthesis
//! - **Roguelikes**: Persistent upgrades, meta-progression
//!
//! # Example
//!
//! ```ignore
//! use issun::builder::GameBuilder;
//! use issun::plugin::research::{ResearchPlugin, ResearchHook, ResearchProject};
//! use async_trait::async_trait;
//!
//! // Custom hook for unlocking content
//! struct TechTreeHook;
//!
//! #[async_trait]
//! impl ResearchHook for TechTreeHook {
//! async fn on_research_completed(
//! &self,
//! project: &ResearchProject,
//! result: &ResearchResult,
//! resources: &mut ResourceContext,
//! ) {
//! // Unlock units, apply bonuses, etc.
//! println!("Research completed: {}", project.name);
//! }
//! }
//!
//! // Create game with research plugin
//! let game = GameBuilder::new()
//! .add_plugin(
//! ResearchPlugin::new()
//! .with_hook(TechTreeHook)
//! )
//! .build()
//! .await?;
//!
//! // Define a research project
//! let project = ResearchProject::new(
//! "plasma_rifle",
//! "Plasma Rifle Mk3",
//! "Advanced energy weapon"
//! )
//! .with_cost(5000)
//! .add_metric("effectiveness", 1.5)
//! .add_metric("reliability", 0.85);
//!
//! // Note: Projects should be added via plugin configuration
//! // Queue research via event
//! let mut bus = resources.get_mut::<EventBus>().await.unwrap();
//! bus.publish(ResearchQueueRequested {
//! project_id: ResearchId::new("plasma_rifle"),
//! });
//! ```
// Re-export public API
pub use ;
pub use *;
pub use ;
pub use ResearchPlugin;
pub use ResearchProjects;
pub use ResearchService;
pub use ResearchState;
pub use ResearchSystem;
pub use ;