L1NNA / SV1DUR

Planes-On-The-Bus-Go-Swish-Swish-Swish
3 stars 1 forks source link

Restructure files #18

Open JBanks opened 2 years ago

JBanks commented 2 years ago

We should split the components in sys.rs into their own files, possibly within a module. The file is almost 1000 lines of code and we're going to start tripping over each other updating things in there. If we split it then we'll have less of a chance of merge conflicts and files will feel more roomy.

Proposal:

bus/
-mod.rs
--use-statements for all structs and traits
-scheduler.rs
--Scheduler
--DefaultScheduler
-device.rs
--Device
--Mode
--State
--AttackType
-messages.rs
--Word
--EventHandler
--DefaultEventHandler
-system.rs
--System
--Router
steven-hh-ding commented 2 years ago

Yah I was thinking something similar at the beginning but gave up due to the circular reference (Device refers to System for types and system refers to device). Same for event handler etc maybe there exists some solution