1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Use real spawn points when available #30

This commit is contained in:
NG (Graham)
2025-07-26 11:47:05 -04:00
parent a27ae3d466
commit c6bd9e110d
13 changed files with 520 additions and 106 deletions

View File

@@ -31,6 +31,7 @@ pub trait ConfigProvider<C: Clone> {
fn is_multiplayer_enabled(&self) -> bool;
// FIXME don't use serializable types in traits
fn network_config(&self) -> crate::persist::NetworkConf;
fn maps(&self) -> std::collections::HashMap<GameMap, MapConfig>;
}
pub struct CompleteCampaignProvider {
@@ -270,7 +271,7 @@ pub struct GameEvent {
pub auto_heal: bool,
}
#[derive(Clone, Debug, Copy)]
#[derive(Clone, Debug, Copy, Hash, PartialEq, Eq)]
pub enum GameMap {
Mars1,
Mars2,
@@ -329,3 +330,22 @@ pub enum VehicleDescriptor {
}
// TODO File
}
#[derive(Clone, Debug)]
pub struct Point {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[derive(Clone, Debug)]
pub struct Sphere {
pub radius: f32,
pub center: Point,
}
#[derive(Clone, Debug)]
pub struct MapConfig {
pub spawns: std::collections::HashMap<u8, Vec<Point>>, // team -> points
pub bases: std::collections::HashMap<u8, Sphere>, // team -> base
}