public CarNavigationADPController() { statenum = CarNavigationQStore.LENXY * CarNavigationQStore.LENXY * CarNavigationQStore.LENANG; r = new Random(); qstore = CarNavigationQStore.Load("qstore.dat"); }
public static CarNavigationQStore Load(string filename) { CarNavigationQStore ret = new CarNavigationQStore(); try { using (FileStream fs = new FileStream(filename, FileMode.Open)) { using (GZipStream stream = new GZipStream(fs, CompressionMode.Decompress)) { using (BinaryReader br = new BinaryReader(stream)) { for (int i = 0; i < LENACTION; ++i) { for (int j = 0; j < LENXY; ++j) { for (int k = 0; k < LENXY; ++k) { for (int l = 0; l < LENANG; ++l) { ret.value[i, j, k, l] = br.ReadSingle(); } } } } } } } } catch (IOException ex) { } return ret; }