mirror of https://github.com/zyllian/classics.git synced 2025-05-10 02:56:41 -07:00

make world generation configurable

This commit is contained in:
Zoey 2024-04-19 12:49:35 -07:00
parent c78303cf44
commit 38164a6cc5
No known key found for this signature in database
GPG key ID: 8611B896D1AAFAF2
4 changed files with 101 additions and 9 deletions

View file

@ -1,5 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::level::generation::LevelGeneration;
/// configuration for the server
#[derive(Debug, Serialize, Deserialize)]
pub struct ServerConfig {
@ -13,6 +15,8 @@ pub struct ServerConfig {
pub level_size: Option<ConfigCoordinates>,
/// the level's spawn point
pub spawn: Option<ConfigCoordinates>,
/// the method to generate the server's level with
pub generation: LevelGeneration,
}
impl Default for ServerConfig {
@ -23,6 +27,7 @@ impl Default for ServerConfig {
password: None,
level_size: None,
spawn: None,
generation: LevelGeneration::Empty,
}
}
}