From b7a59798ea69b403b14de128bc505d9bcb29fa4c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 6 Apr 2025 17:42:18 +0200 Subject: add tram entity, works badly --- server/src/entity/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/src/entity/mod.rs') diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs index 044fccab..60f02d2a 100644 --- a/server/src/entity/mod.rs +++ b/server/src/entity/mod.rs @@ -23,6 +23,7 @@ pub mod customers; pub mod environment_effect; pub mod item_portal; pub mod player_portal; +pub mod tram; pub mod tutorial; use crate::{ @@ -45,6 +46,7 @@ use item_portal::ItemPortal; use player_portal::PlayerPortal; use serde::{Deserialize, Serialize}; use std::{any::Any, collections::VecDeque}; +use tram::Tram; pub type DynEntity = Box; pub type Entities = Vec; @@ -133,6 +135,11 @@ pub enum EntityDecl { location: Option, condition: GateCondition, }, + Tram { + length: usize, + character: Option, + points: Vec, + }, Book, } @@ -198,5 +205,10 @@ pub fn construct_entity( } EntityDecl::EnvironmentEffect(config) => Box::new(EnvironmentEffectController::new(config)), EntityDecl::Environment(names) => Box::new(EnvironmentController(names)), + EntityDecl::Tram { + length, + character, + points, + } => Box::new(Tram::new(character.unwrap_or(51), length, points)), }) } -- cgit v1.2.3-70-g09d2