Пример #1
0
 public static void Clear()
 {
     if (Storage == null)
     {
         CreateStorage();
     }
     Storage.Clear();
 }
Пример #2
0
 /// <summary>
 /// Clear DataStream and reset counters
 /// </summary>
 public void Reset()
 {
     dataBuffer.Clear();
     foreach (var key in nodesMaxReadedDataNumber.Keys.ToArray())
     {
         nodesMaxReadedDataNumber[key] = -1;
     }
     belongsTo.Reset();
 }
Пример #3
0
 private void ExecuteTheDoor(Int32 currentDoor)
 {
     if (currentDoor == 0)
     {
         if (!dataStorage.IsEmpty())
         {
             Int32 lastDoor = dataStorage.GetLastDoor();
             for (Int32 i = 0; i < doors.Length; i++)
             {
                 doors[i] /= lastDoor;
             }
             inputOutputDevice.WriteOutput(
                 phraseProvider.GetPhrase(Phrase.weSelectNumber) + "0" + phraseProvider.GetPhrase(Phrase.andGoPrevLevel)
                 );
             inputOutputDevice.WriteOutput(ShowLevel());
         }
         else
         {
             inputOutputDevice.WriteOutput(phraseProvider.GetPhrase(Phrase.itsFirstLevel));
         }
     }
     else //if door != 0
     {
         dataStorage.PushLastDoor(currentDoor);
         for (Int32 i = 0; i < doors.Length; i++)
         {
             try
             {
                 checked
                 {
                     doors[i] *= currentDoor;
                 }
             }
             catch (OverflowException)
             {
                 inputOutputDevice.WriteOutput(phraseProvider.GetPhrase(Phrase.youGetToFar));
                 InitiateDoors();
                 dataStorage.Clear();
                 ShowDoors();
                 return;
             }
         }
         inputOutputDevice.WriteOutput(
             phraseProvider.GetPhrase(Phrase.weSelectNumber) + currentDoor.ToString() + phraseProvider.GetPhrase(Phrase.andGoNextLevel)
             );
         inputOutputDevice.WriteOutput(ShowLevel());
     }
 }