Skip to main content

weiss_core/state/
player.rs

1use super::{CardInstance, StageSlot};
2
3/// Full per-player state.
4#[derive(Clone, Debug, Hash)]
5pub struct PlayerState {
6    /// Deck (top at end of vector).
7    pub deck: Vec<CardInstance>,
8    /// Hand.
9    pub hand: Vec<CardInstance>,
10    /// Waiting room.
11    pub waiting_room: Vec<CardInstance>,
12    /// Clock.
13    pub clock: Vec<CardInstance>,
14    /// Level zone.
15    pub level: Vec<CardInstance>,
16    /// Stock (top at end of vector).
17    pub stock: Vec<CardInstance>,
18    /// Memory.
19    pub memory: Vec<CardInstance>,
20    /// Climax zone.
21    pub climax: Vec<CardInstance>,
22    /// Resolution zone (temporary).
23    pub resolution: Vec<CardInstance>,
24    /// Stage slots (5 total).
25    pub stage: [StageSlot; 5],
26}
27
28impl PlayerState {
29    /// Create a new player state with an initial deck.
30    pub fn new(deck: Vec<CardInstance>) -> Self {
31        Self {
32            deck,
33            hand: Vec::new(),
34            waiting_room: Vec::new(),
35            clock: Vec::new(),
36            level: Vec::new(),
37            stock: Vec::new(),
38            memory: Vec::new(),
39            climax: Vec::new(),
40            resolution: Vec::new(),
41            stage: [
42                StageSlot::empty(),
43                StageSlot::empty(),
44                StageSlot::empty(),
45                StageSlot::empty(),
46                StageSlot::empty(),
47            ],
48        }
49    }
50}