Ejemplo n.º 1
0
 public static void ReadEnemyList()
 {
     EnemyList = new List<Enemy>();
     string[] lines = Properties.Resources.ENEMIES.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
     int i = 0;
     while (i < lines.Length)
     {
         if (lines[i].StartsWith("-"))
         {
             i++;
             continue;
         }
         Enemy e = new Enemy();
         e.Actor = Convert.ToInt32(lines[i], 16);
         e.Object = Convert.ToInt32(lines[i + 1], 16);
         e.ObjectSize = ObjUtils.GetObjSize(e.Object);
         string[] varlist = lines[i + 2].Split(',');
         for (int j = 0; j <  varlist.Length; j++)
         {
             e.Variables.Add(Convert.ToInt32(varlist[j], 16));
         }
         e.Type = Convert.ToInt32(lines[i + 3], 16);
         e.Stationary = Convert.ToInt32(lines[i + 4], 16);
         if (lines[i + 5] != "")
         {
             string[] selist = lines[i + 5].Split(',');
             for (int j = 0; j < selist.Length; j++)
             {
                 e.SceneExclude.Add(Convert.ToInt32(selist[j], 16));
             }
         }
         EnemyList.Add(e);
         i += 6;
     }
 }