I'll stay with my config file parser and my runway lights class, because I looked in your code and using it would mean a lot of refactoring. However, I totally agree to take the same parameters as you, asmi. It creates much more realistic lights. The fact that you already did it one time will help me creating realistic ones too.
Perfect jarmonik! I'll try to work on the creation code this week-end, but I'm pretty busy.
Edit:
Some lights will have two colors; one for when we are landing towards it and another when we are not. For example, when we are landing, the latest runway center lines are red. However, the meaning of "latest" changes when we are landing on the other side. I don't know if my sentence is clear...
So, do I specify two colors (front and back colors) or I defined them twice. The first idea is cheaper on the memory, but the latest is cheaper at run-time... It all depends on your implementation of the beacons.
Ok, whatever is easier for you. In this case let me give you some clues (they all are in comments inside the code, so you might want to just read it through). I've done some research on the subject, including checking with FAA regulations, and here is a layout that I've implemented.
1. For lights along the runway's centriline:
If distance from the edge of the runway (that is the closest end of the runway) is more than 914 meters, then the light have to be white.
If distance is less than 914 m, but more than 305 m, the lights have to be interleaving white and red.
If distance is less than 305 m, the lights have to be red.
2. For lights along the runway's borders:
If distance from the edge is more than 610 meters - they have to be white, otherwise - yellow.
Here is a picture that visually represents what I've just said:
Remember that all these distances are calculated from the actual RWY start so END1/2-TD_DISP.
Please let me know if it helps, and if so - I can outline here the rest of details, or as I've said you can just refer to the code - I tried to put enough comments so readers whould get what is going on right from reading the source.