Terasology / AdditionalRails

3 stars 11 forks source link

Pressure plate rail proposal #21

Open eviltak opened 6 years ago

eviltak commented 6 years ago

Description

The rail will emit a signal of infinite strength for the duration a vehicle is on it, much like the pressure plate in the signalling module.

Dependencies

Proposed Implementation

Much like the booster rail implementation, the segment entry and exit events will be used to detect the presence of a cart on it. This can be done by maintaining a count of the number of vehicles on top of the rail; a counter is incremented and decremented every time the entry and exit events are called respectively. The counter method may seem unnecessary at first, but will come in handy when the multi-axle carts are released.

On every update, if the above defined counter is non-zero, there is something on top of the rail and a signal is emitted.

Possible uses