/// <summary>
 /// Этот метод дёргать когда надо закончить стадию при выполнении условия.
 /// </summary>
 /// <param name="condition">условие завершения</param>
 protected void FinishStage(Func <bool> condition, IGameStateEntity entity)
 {
     if (condition.Invoke())
     {
         FinishStage(entity);
     }
 }
Beispiel #2
0
 public bool AddEntity(IGameStateEntity entity)
 {
     if (entity == GameStateEntity.Empty)
     {
         return(true);
     }
     _entitiesContainer[entity.GetType()] = entity;
     return(true);
 }
Beispiel #3
0
 public GameStateUseCase(IGameStateEntity gameStateEntity, IGameStateModel gameStateModel)
 {
     _gameStateEntity = gameStateEntity;
     _gameStateModel  = gameStateModel;
 }
 public IGameStateModel Translate(IGameStateEntity entity)
 {
     return(new GameStateModel(entity.RemainingTime));
 }
 private void OnCancelStage(object source, IGameStateEntity entity)
 {
     OnCompleteStage(source, entity);
 }