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
//! Policy management plugin for strategy and simulation games
//!
//! This plugin provides generic policy/card/buff management with:
//! - Generic effects system (no hard-coded game mechanics)
//! - Flexible aggregation strategies (Multiply, Add, Max, Min)
//! - Hook-based customization for game-specific logic
//! - Event-driven architecture for network replication
//! - Single-active OR multi-active policy modes
//!
//! # Example
//!
//! ```ignore
//! use issun::plugin::policy::{PolicyPlugin, PolicyRegistry, Policy, AggregationStrategy};
//! use issun::builder::GameBuilder;
//! use std::collections::HashMap;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create game with policy plugin
//! let game = GameBuilder::new()
//! .add_plugin(PolicyPlugin::new())
//! .build()
//! .await?;
//!
//! // Add policies to the registry
//! let mut registry = game.resources.get_mut::<PolicyRegistry>().await.unwrap();
//!
//! let policy = Policy::new(
//! "investor_friendly",
//! "Investor-Friendly Policy",
//! "Increases dividend demands but improves investment efficiency"
//! )
//! .add_effect("dividend_multiplier", 1.2)
//! .add_effect("investment_bonus", 1.3);
//!
//! registry.add(policy);
//!
//! // Activate a policy
//! registry.activate(&"investor_friendly".into()).unwrap();
//!
//! // Get aggregated effects
//! let income_mult = registry.get_effect("dividend_multiplier");
//! println!("Income multiplier: {}", income_mult);
//! # Ok(())
//! # }
//! ```
// Public exports
pub use PolicyConfig;
pub use *;
pub use ;
pub use PolicyPlugin;
pub use Policies;
pub use PolicyService;
pub use PolicyState;
pub use ;