Well, you wouldn't have to check every event and every station if you create a queue that stores the times in sorted order. You only have to check one event to see if it has elapsed. If so, then you check the next and the next until all elapsed events have been handled. Part of handling a continuous event would be to schedule it again once you are done with handling it.
Since all stations should be the same object, you shouldn't have a problem with calling the event or knowing what parameters to pass.
You could have a very simple structure like this:
Type TStationEvent
TimeAmount:Float ' Stored in Game Time
Station:TStation
End Type
You would only require one event stored for each station. It would be best if each station had some randomization like the occasional manufacturing problem that shutsdown the plant for a short amount of time. If you do this, then you just add an EventTypeID to your structure and decide how to handle the event when you pass it to the Station object.
Once the Game Time has elapsed for the first event, you dequeue the event and call your method from the Station field. Then reschedule the event into your queue. You can either keep looping or allow the main logic loop to continue and catch the next elapsed event the next pass through. This way there isn't long pauses from multiple events and the amount of time between station events is large enough that most computers should be able to loop through 1000 stations in that amount of time. You might get a couple events that are slightly older than they should be but to the player, they wont notice since it would only be a small fraction of a second.
Since all stations should be the same object, you shouldn't have a problem with calling the event or knowing what parameters to pass.
You could have a very simple structure like this:
Type TStationEvent
TimeAmount:Float ' Stored in Game Time
Station:TStation
End Type
You would only require one event stored for each station. It would be best if each station had some randomization like the occasional manufacturing problem that shutsdown the plant for a short amount of time. If you do this, then you just add an EventTypeID to your structure and decide how to handle the event when you pass it to the Station object.
Once the Game Time has elapsed for the first event, you dequeue the event and call your method from the Station field. Then reschedule the event into your queue. You can either keep looping or allow the main logic loop to continue and catch the next elapsed event the next pass through. This way there isn't long pauses from multiple events and the amount of time between station events is large enough that most computers should be able to loop through 1000 stations in that amount of time. You might get a couple events that are slightly older than they should be but to the player, they wont notice since it would only be a small fraction of a second.