public GameContext(TimeContext timeContext) { StateService.Instance.SetStateTo <NotAGameState>(this); if (timeContext == null) { throw new ArgumentException("TimeContext could not be null"); } this.TimeContext = timeContext; GameProperties = timeContext.GameProperties; }
public void goNext(TimeContext context) { if (context.TimeCount != 0) { StateService.Instance.SetStateTo <TimeInProgressState>(context); } else { StateService.Instance.SetStateTo <TimeLimboState>(context); } }
public void goNext(TimeContext context) { disActivateSupervisors(context.GameProperties); TimeService.Instance.PauseTimer.CallAfter(() => { context.CurrentTimeInc(); if (context.CurrentTime <= context.TimeCount) { StateService.Instance.SetStateTo <TimeInProgressState>(context); } else { StateService.Instance.SetStateTo <TimeLimboState>(context); } }); TimeService.Instance.PauseTimer.Start(); }
public void goNext(TimeContext context) { }
public void goNext(TimeContext context) { activateSupervisors(context.GameProperties); TimeService.Instance.GameTimer.CallAfter(() => StateService.Instance.SetStateTo <TimeEndedState>(context)); TimeService.Instance.GameTimer.Start(); }
public void SetStateTo <S>(TimeContext context) where S : ITimeState { var state = State <S>(); context.CurrentTimeState = state; }