use chrono::{DateTime, Utc};
use serde::{Serialize, Deserialize};
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct DamageLog {
timestamp: DateTime::<Utc>,
damage: isize,
other_player: String,
other_ship: String,
weapon: String,
destination: Destination,
}
impl DamageLog {
pub fn new(timestamp: DateTime::<Utc>, damage: isize, other_player: String, other_ship: String, weapon: String, destination: Destination) -> Self {
DamageLog { timestamp, damage, other_player, other_ship, weapon, destination }
}
}
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct LogiLog {
timestamp: DateTime::<Utc>,
amount: isize,
other_player: String,
other_ship: String,
rep_type: String,
destination: Destination,
}
impl LogiLog {
pub fn new(timestamp: DateTime::<Utc>, amount: isize, other_player: String, other_ship: String, rep_type: String, destination: Destination) -> Self {
LogiLog { timestamp, amount, other_player, other_ship, rep_type, destination }
}
}
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Destination {
Receiving,
Dealing,
}
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Log {
Damage(DamageLog),
Logi(LogiLog),
}