Пример #1
0
 private void LoadFromFile(string path)
 {
     using (FileStream inputStream = new FileStream(path, FileMode.Open))
         using (MemoryStream memoryStream = new MemoryStream())
         {
             inputStream.CopyTo(memoryStream);
             handRankMap = HashMap.Deserialize(memoryStream.ToArray());
         }
 }
Пример #2
0
        private void LoadFromTextAsset(byte[] bytes)
        {
            Stream          s         = new MemoryStream(bytes);
            BinaryFormatter formatter = new BinaryFormatter();

            using (MemoryStream memoryStream = new MemoryStream())
            {
                s.CopyTo(memoryStream);
                handRankMap = HashMap.Deserialize(memoryStream.ToArray());
            }
            s.Close();
        }
Пример #3
0
 private void LoadFromFile(string path)
 {
     if (!string.IsNullOrWhiteSpace(path) && !File.Exists(path))
     {
         throw new ArgumentException(string.Format("File {0} does not exist", path));
     }
     else
     {
         if (debug)
         {
             Console.WriteLine("Loading table from {0}", path);
         }
         using (FileStream fs = new FileStream(path, FileMode.Open))
         {
             handRankMap = HashMap.Deserialize(fs);
         }
     }
 }