Exemple #1
0
        private void Update(Sfs.Time dt)
        {
            switch (_userInputController.ActualState.Condition)
            {
            case StateCondition.Switching:
                var newState = _userInputController.ActualState.SwitchToThis;
                _userInputController.ActualState         = newState;
                _userInputController.ActualViewContainer = newState.Name == nameof(SummaryState)
                        ? (IViewContainer) new SummaryStateView(newState as SummaryState)
                        : new GameplayStateView(newState as GameplayState);
                break;

            case StateCondition.Running:
                // do nothing, everything is ok
                break;

            case StateCondition.Stopped:
                _window.Close();
                break;

            case StateCondition.Error:
                _window.Close();
                Environment.Exit(1);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            _userInputController.ActualState.Update(dt);
        }
        public override void Update(Sfs.Time dt)
        {
            base.Update(dt);
            var scoreOld = Score;

            Score += _scoreResolver.ClearFullLanesAndGetPoints(World.Matrix);
            if (scoreOld != Score)
            {
                ((RecurrentScheduler)_droppingScheduler).Timeout *= 0.9f;
            }
        }
        public void UpdateCurrent(Sfs.Time dt)
        {
            ElapsedTime += dt;

            if (ElapsedTime <= Timeout)
            {
                return;
            }

            ToExecute();
            ElapsedTime = Sfs.Time.Zero;
        }
Exemple #4
0
        public void UpdateCurrent(Sfs.Time dt)
        {
            if (!CurrentPiece.Grounded)
            {
                return;
            }

            CurrentPiece = NextTermino();
            if (CurrentPiece.IsOccupied(CurrentPiece.Position, Matrix))
            {
                WorldEnded = true;
            }
        }
 protected override void OnSeek(SFML.System.Time timeOffset)
 {
     PlayingOffset = SFML.System.Time.FromMilliseconds((timeOffset.AsMilliseconds()) / 1000 * 44100);
 }
 public RecurrentTaskBuilder Every(Sfs.Time time)
 {
     return(new RecurrentTaskBuilder(_scheduler, time));
 }
Exemple #7
0
 public void UpdateCurrent(Sfs.Time dt)
 {
 }
 public RecurrentTaskBuilder(IScheduler scheduler, Sfs.Time time)
 {
     _scheduler = scheduler;
     _timeout   = time;
 }