示例#1
0
 public TeamDataModel(string nameVal, CountdownModel countdown, Int16 plat1, Int16 plat2, Int16 obs1, Int16 obs2, Int16 hover,
                      Int16 start, Int16 motor1, Int16 motor2, int fwdTime, int backTime, Int16 frontLim, Int16 backLim)
 {
     Name        = nameVal;
     TeamControl = new TeamControlModel(plat1, plat2, obs1, obs2, hover, start, motor1, motor2, fwdTime, backTime, frontLim, backLim);
     TeamGame    = new TeamGameModel(TeamScore, TeamControl, countdown);
 }
示例#2
0
        public TeamGameModel(TeamScoreModel teamScore, TeamControlModel teamControl, CountdownModel countdown)
        {
            _teamScore   = teamScore;
            _teamControl = teamControl;

            //time event setup
            _countdown   = countdown;
            startLeft    = countdown.Timeout.TotalMilliseconds - Constants.startTime;
            hoverLeft    = countdown.Timeout.TotalMilliseconds - Constants.hoverTime;
            obstacleLeft = countdown.Timeout.TotalMilliseconds - Constants.obstacleTime;
            platformLeft = countdown.Timeout.TotalMilliseconds - Constants.platformTime;
            _countdown.PropertyChanged += OnTimeChange;
            _blinkTimer = new Timer(Constants.preStartBlinkInterval)
            {
                AutoReset = true
            };
            _blinkTimer.Elapsed += OnBlinkElapsed;
        }