Exemplo n.º 1
0
 internal EffectBrowser(string filename)
 {
     using (FileParser parser = new FileParser("effects.txt"))
     {
         string[] effect = parser.ParseLine();   //dummy read to pass headers
         while ((effect = parser.ParseLine()) != null)
         {
             effects.Add(new Effect(effect[0],                          //name
                                    effect[1],                          //description
                                    (float)Convert.ToDouble(effect[2]), //cost
                                    Convert.ToInt32(effect[3]),         //mag
                                    Convert.ToInt32(effect[4]),         //dur
                                    Convert.ToInt32(effect[5])          //value
                                    ));
         }
     }
 }
Exemplo n.º 2
0
 internal IngredientBrowser(string filename)
 {
     using (FileParser parser = new FileParser("ingredients.txt"))
     {
         string[] ingredient = parser.ParseLine();   //dummy read to pass headers
         while ((ingredient = parser.ParseLine()) != null)
         {
             ingredients.Add(new Ingredient(ingredient[0],                          //name
                                            ingredient[1],                          //effect1
                                            ingredient[2],                          //effect2
                                            ingredient[3],                          //effect3
                                            ingredient[4],                          //effect4
                                            (float)Convert.ToDouble(ingredient[5]), //weight
                                            Convert.ToInt32(ingredient[6]),         //value
                                            ingredient[7],                          //obtained
                                            effectBrowser                           //effectbrowser
                                            ));
         }
     }
 }