mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Modularized reusable structs and changed files structure a bit
This commit is contained in:
parent
faaedf44f0
commit
9df4bddc09
19 changed files with 279 additions and 1063 deletions
|
|
@ -1,23 +1,7 @@
|
|||
use crate::GDResult;
|
||||
use crate::protocols::valve;
|
||||
use crate::protocols::valve::{App, Server, ServerPlayer, GatheringSettings};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Player {
|
||||
pub name: String,
|
||||
pub score: u32,
|
||||
pub duration: f32
|
||||
}
|
||||
|
||||
impl Player {
|
||||
fn from_valve_response(player: &ServerPlayer) -> Self {
|
||||
Self {
|
||||
name: player.name.clone(),
|
||||
score: player.score,
|
||||
duration: player.duration
|
||||
}
|
||||
}
|
||||
}
|
||||
use crate::protocols::valve::game::Player;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Response {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue