pub type Zombie = Player;Expand description
Represents a zombie player.
Aliased Type§
pub struct Zombie {Show 24 fields
pub id: String,
pub name: String,
pub surname: String,
pub bio: String,
pub pronouns: String,
pub alias: String,
pub niu: String,
pub email: String,
pub phone: String,
pub faculty: String,
pub isuab: bool,
pub how_did_you_hear_about_us: String,
pub social_media: Option<String>,
pub password: String,
pub player_number: i32,
pub state: PlayerState,
pub role: PlayerRole,
pub birth_date: NaiveDate,
pub accept_info_other_editions: bool,
pub next_feeding: Option<CustomDateTime>,
pub last_login: Option<NaiveDateTime>,
pub checkpoint: Option<NaiveDateTime>,
pub wants_to_be_zombie: i32,
pub register_date: Option<NaiveDateTime>,
}Fields§
§id: String§name: String§surname: String§bio: String§pronouns: String§alias: String§niu: String§email: String§phone: String§faculty: String§isuab: bool§how_did_you_hear_about_us: String§password: String§player_number: i32§state: PlayerState§role: PlayerRole§birth_date: NaiveDate§accept_info_other_editions: bool§next_feeding: Option<CustomDateTime>§last_login: Option<NaiveDateTime>§checkpoint: Option<NaiveDateTime>§wants_to_be_zombie: i32§register_date: Option<NaiveDateTime>Implementations§
Source§impl Zombie
impl Zombie
Sourcepub async fn get_next_feeding(&self) -> Result<Option<CustomDateTime>, String>
pub async fn get_next_feeding(&self) -> Result<Option<CustomDateTime>, String>
Calculates the next feeding time for a zombie player.
Returns None if the player is not a zombie.
§Errors
Returns an error if the player is not a zombie.
Sourcepub async fn starvation(
&self,
) -> Result<Vec<(String, Option<CustomDateTime>)>, String>
pub async fn starvation( &self, ) -> Result<Vec<(String, Option<CustomDateTime>)>, String>
Sourcepub async fn hunt(
&self,
target: &Player,
feed1: Option<&Player>,
feed2: Option<&Player>,
) -> Result<(), String>
pub async fn hunt( &self, target: &Player, feed1: Option<&Player>, feed2: Option<&Player>, ) -> Result<(), String>
Sourcepub fn feeding_time_calc() -> Result<CustomDateTime, String>
pub fn feeding_time_calc() -> Result<CustomDateTime, String>
Sourcepub async fn monitor_zombie_death() -> !
pub async fn monitor_zombie_death() -> !
Monitors the zombie death and updates the player state accordingly.
Every minute, it checks if the player’s next feeding time has passed. If so, it updates the player’s state to Corpse and sets the next feeding time to None.
§Errors
Returns an error if the player is not a zombie.