weiss_core/state/
cards.rs1use serde::{Deserialize, Serialize};
2
3use crate::db::CardId;
4
5pub type CardInstanceId = u32;
7
8#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
10pub struct CardInstance {
11 pub id: CardId,
13 pub instance_id: CardInstanceId,
15 pub owner: u8,
17 pub controller: u8,
19}
20
21impl CardInstance {
22 pub fn new(id: CardId, owner: u8, instance_id: CardInstanceId) -> Self {
24 Self {
25 id,
26 instance_id,
27 owner,
28 controller: owner,
29 }
30 }
31}