public override CGObject ReadObject(BinaryReader reader, int objectId, MapPosition objectPosition) { CGResource resource = new CGResource(); ReadMessageAndGuards(reader, resource); resource.Amount = (int)reader.ReadUInt32(); if ((EResourceType)this.ObjectTemplate.SubId == EResourceType.GOLD) { // Gold is multiplied by 100. resource.Amount *= 100; } reader.Skip(4); return(resource); }
} // End CGAVIFileEditor() #endregion // ****************************************************************** // Overrides. // ****************************************************************** #region Overrides /// <summary> /// Initializes the file-open dialog. /// </summary> /// <param name="openFileDialog">The dialog to be initialized.</param> protected override void InitializeDialog( OpenFileDialog openFileDialog ) { openFileDialog.Title = CGResource.GetString( typeof(CGAVIFileEditor), "dialog_title" ); openFileDialog.Filter = CGResource.GetString( typeof(CGAVIFileEditor), "dialog_filter" ); openFileDialog.DefaultExt = CGResource.GetString( typeof(CGAVIFileEditor), "default_ext" ); openFileDialog.CheckFileExists = true; openFileDialog.DereferenceLinks = true; } // End InitializeDialog()