コード例 #1
0
 public FormEntityView()
 {
     InitializeComponent();
     entityData = new GameEntityData[256];
     statData   = new BaseStatData[256];
     for (int i = 0; i < 256; ++i)
     {
         statData[i] = new BaseStatData();
     }
     comboBoxObj.DataSource = GetEntityNames();
     comboBoxSpr.DataSource = GetSpriteNames();
     if (!Settings.Default.rootpath.Equals(String.Empty))
     {
         LoadFromFile(Settings.Default.rootpath + "entities.rzdb");
     }
 }
コード例 #2
0
 private void LoadFromFile(string fname)
 {
     try
     {
         textBoxFile.Text = fname;
         RZDBReader br = new RZDBReader(File.OpenRead(fname));
         entityCount = br.ReadSize();
         for (int i = 0; i < entityCount; ++i)
         {
             entityData[i] = new GameEntityData(br);
         }
         statTableSize = br.ReadSize();
         for (int i = 0; i < statTableSize; ++i)
         {
             statData[i] = new BaseStatData(br);
         }
         br.Close();
         comboBoxObj.SelectedIndex = 0;
     }
     catch (Exception)
     {
         MessageBox.Show("Invalid file.");
     }
 }