wOxlf/src/game/player_data.rs

23 lines
506 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct PlayerData {
pub channel: u64,
pub discord_id: u64,
pub codename: String,
pub vote_target: Option<u64>,
pub profile_pic_url: String,
pub channel_webhook_id: u64,
pub alive: bool,
}
impl PlayerData {
pub fn cast_vote(&mut self, vote_target_id: u64) {
self.vote_target = Some(vote_target_id)
}
pub fn clear(&mut self) {
self.vote_target = None;
}
}