Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.     public abstract class LocalizationInfo
  2.     {
  3.         public abstract LocalizationInfo(string[] lines)
  4.         {
  5.         }
  6.     }
  7.  
  8.     private T LoadInfo<T>(string filename) where T : LocalizationInfo
  9.     {
  10.         // initiaize
  11.         T info;
  12.  
  13.         // load asset
  14.         var asset = LoadLocalizationAsset(filename);
  15.         if (asset == null) return null;
  16.  
  17.         // get the (singular) id block
  18.         string idBlock = GetIDBlocks(asset)[0];
  19.  
  20.         // split the block by lines
  21.         string[] split = new string[] { "\n" };
  22.         var lines = idBlock.Split(split, StringSplitOptions.RemoveEmptyEntries);
  23.  
  24.         info = new T(lines);
  25.  
  26.         return info;
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement