Search in sources :

Example 1 with TrackController

use of trackctrl.model.TrackController in project on-track by michaelplazek.

the class TrackControllerInitializer method parseTrack.

/**
 * Searches the Track Model instances and populates TrackControllerLineManagers
 * and TrackControllers.
 */
public static void parseTrack() {
    HashMap<String, Track> track = Track.getListOfTracks();
    TrackControllerLineManager[] lms = new TrackControllerLineManager[2];
    // TrackControllerLineManager[] lms = new TrackControllerLineManager[track.size()];
    // Create TrackControllerLineManagers
    // int i = 0;
    // for (Map.Entry<String, Track> entry : track.entrySet()) {
    // i++;
    // lms[i] = new TrackControllerLineManager(entry.getKey());
    // for (String block : entry.getValue().getBlockList()) {
    // //add each block to a track controller
    // 
    // 
    // }
    // }
    lms[0] = new TrackControllerLineManager("Green");
    lms[1] = new TrackControllerLineManager("Red");
    // DUMMY DATA
    TrackController[] gtc = new TrackController[10];
    TrackController[] rtc = new TrackController[10];
    for (int i = 0; i < 10; i++) {
        gtc[i] = new TrackController(i + 1, 0);
        lms[0].addController(gtc[i]);
        rtc[i] = new TrackController(i + 1, 0);
        lms[1].addController(rtc[i]);
    }
}
Also used : TrackController(trackctrl.model.TrackController) TrackControllerLineManager(trackctrl.model.TrackControllerLineManager) Track(trackmodel.model.Track)

Aggregations

TrackController (trackctrl.model.TrackController)1 TrackControllerLineManager (trackctrl.model.TrackControllerLineManager)1 Track (trackmodel.model.Track)1