Exemplo n.º 1
0
 public static Sprite CreateNewSprite(String path)
 {
     Sprite result = new Sprite(new List<Sprite.SpriteAction>());
     string line;
     System.IO.StreamReader file = new System.IO.StreamReader("Content/Stats/NPCStats.txt");
     while ((line = file.ReadLine()) != null)
     {
         char[] delimiters = new char[] { ',' };
         string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
         UnitStats u = new UnitStats();
         u.init(parts);
         if(u.model.CompareTo(path)==0)
         {
             result.setParam(u, 0, 0);
             return result;
         }
     }
     return result;
 }
Exemplo n.º 2
0
 public List<UnitStats> FileToSprite(String path)
 {
     List<UnitStats> result = new List<UnitStats>();
     string line;
     System.IO.StreamReader file = new System.IO.StreamReader(path);
     while((line = file.ReadLine())!=null)
     {
         char[] delimiters = new char[] { ',' };
         string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
         UnitStats u = new UnitStats();
         u.init(parts);
         result.Add(u);
     }
     return result;
 }