From 4c9eede9fdbfe6786d395f6ca4a0ac083491aff2 Mon Sep 17 00:00:00 2001 From: Louis Pearson Date: Thu, 8 Apr 2021 05:40:56 -0600 Subject: [PATCH] Document Travel enum --- server/src/rtsim/entity.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/rtsim/entity.rs b/server/src/rtsim/entity.rs index 836a503691..8110498fd7 100644 --- a/server/src/rtsim/entity.rs +++ b/server/src/rtsim/entity.rs @@ -500,18 +500,30 @@ impl Entity { #[derive(Clone, Debug)] enum Travel { + // The initial state all entities start in, and a fallback for when a state has stopped making + // sense. Non humanoids will always revert to this state after reaching their goal since the + // current site they are in doesn't change their behavior. Lost, + // When an rtsim entity reaches a site it will switch to this state to restart their + // pathfinding from the beginning. Useful when the entity needs to know its current site to + // decide their next target. InSite { site_id: Id, }, + // Move directly to a target site. Used by birds mostly, but also by humands who cannot find a + // path. Direct { target_id: Id, }, + // Follow a custom path to reach the destination. Airships define a custom path to reduce the + // chance of collisions. CustomPath { target_id: Id, path: Vec>, progress: usize, }, + // Follow a track defined in the track_map to reach a site. Humanoids do this whenever + // possible. Path { target_id: Id, track_id: Id,