Network networking
This commit is contained in:
parent
c9a7e071cd
commit
eafc7cfced
14 changed files with 334 additions and 36 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use crate::starchart::star::StarInfo;
|
||||
use bevy::ecs::component::Component;
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Component, PartialEq, Clone)]
|
||||
pub struct EntityID(pub u32);
|
||||
#[derive(Serialize, Deserialize, Debug, Component)]
|
||||
pub enum ObjectUpdate {
|
||||
pub enum NetworkObject {
|
||||
Star(StarInfo),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
pub mod generic;
|
||||
pub mod starchart;
|
||||
pub const SCALEAU: f32 = 1.0;
|
||||
pub const SCALEAU: f32 = 1000000.0;
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ use serde::{Deserialize, Serialize};
|
|||
fn solar_radius_to_ly_scaled(r: f32) -> f32 {
|
||||
r * SOLARRADIUSTOLY * SCALEAU
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub enum StarClass {
|
||||
MType,
|
||||
BType,
|
||||
GType,
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Debug, Component)]
|
||||
#[derive(Serialize, Deserialize, Debug, Component, Clone)]
|
||||
pub struct StarInfo {
|
||||
pub id: EntityID,
|
||||
pub name: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue