예제 #1
0
 public bool HasLevel(int level)
 {
     // If the level was seen before
     if (m_cache.ContainsKey(level))
     {
         return(true);
     }
     return(originalProvider.HasLevel(level));
 }
예제 #2
0
 private void StartLevel()
 {
     if (m_levelProvider.HasLevel(m_difficulty))
     {
         var level = m_levelProvider.GetLevel(m_difficulty); // Getting the level from the provider
         if (level != null)
         {
             m_levelTemplate.LoadLevel(level);                          // Loading the Level to the template
             m_boardDisplayer.ClearBoard();                             // Clearing the Board
             m_boardDisplayer.DisplayBoard(m_levelTemplate.GetBoard()); // Displaying the board of the game
             m_stateMachine.SetBoard(m_levelTemplate.GetBoard());       // Storing the board
             m_stateMachine.SetWorker(m_levelTemplate.GetWorker());     // Storing the worker
         }
     }
     else
     {
         EndGame();
     }
 }