soundprojects / trainsim

Train simulator written in Rust
1 stars 0 forks source link

Switches #9

Open soundprojects opened 2 years ago

soundprojects commented 2 years ago

A switch needs to be a struct similar to track (perhaps some traits to share here, like setting route etc) Switch has two switch states, left or right direction and a reserved field.

For now we just make simple one split switches.

soundprojects commented 2 years ago

Switch currently has four options (split up, split down, merge up, and merge down) where split or merge indicates if, looking from left to right we go from two tracks to one or vice versa. Up and down has to do with either:

       -----
-----/----

or

-----\----
       ----