Exemple #1
0
 /// <summary>
 /// Gets a cell from either data
 /// </summary>
 /// <typeparam name="T">The cell's data type</typeparam>
 /// <param name="type">The data source. Must be a valid SlkReader</param>
 /// <param name="row">The row</param>
 /// <param name="col">The column</param>
 /// <returns>The requested cell</returns>
 public static T GetData <T>(SlkReader dat, string row, string col)
 {
     if (typeof(T) == typeof(bool))
     {
         return((T)Convert.ChangeType(dat.GetBoolCell(row, col), typeof(T)));
     }
     return((T)Convert.ChangeType(dat.GetStringCell(row, col), typeof(T)));
 }
Exemple #2
0
 static GameData()
 {
     if (File.Exists(System.Windows.Forms.Application.StartupPath + "/Content/units.lss"))
     {
         UnitData = new SlkReader(System.Windows.Forms.Application.StartupPath + "/Content/units.lss");
     }
     if (File.Exists(System.Windows.Forms.Application.StartupPath + "/Content/abilities.la"))
     {
         AbilityData = new SlkReader(System.Windows.Forms.Application.StartupPath + "/Content/abilities.la");
     }
 }