~starkingdoms/starkingdoms

ref: a2850ebac0aef4aaeda111ccf4ae8ea1b35eb5b3 starkingdoms/crates/server/src/player/component.rs -rw-r--r-- 710 bytes
a2850ebaghostly_zsh feat: turn off starfield when zoomed out significantly 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use std::net::SocketAddr;

use bevy::prelude::{Bundle, Component, Entity};
use serde::{Deserialize, Serialize};

use crate::module::component::{Attach, PartBundle};

#[derive(Component, Clone, Copy, Serialize, Deserialize, Debug, Default)]
pub struct Input {
    pub up: bool,
    pub down: bool,
    pub left: bool,
    pub right: bool,
}

#[derive(Component, Clone, Debug)]
pub struct Player {
    pub addr: SocketAddr,
    pub username: String,
    pub input: Input,
    pub selected: Option<Entity>,
    pub save_eligibility: bool,
    pub energy_capacity: u32,
    pub energy: u32,
}

#[derive(Bundle)]
pub struct PlayerBundle {
    pub part: PartBundle,
    pub player: Player,
    pub attach: Attach,
}