internal static unsafe collar_k5_rec MoveCK(INCCSelector se, INCCAnalysisParams.INCCMethodDescriptor md) { INCCAnalysisParams.collar_combined_rec imr = (INCCAnalysisParams.collar_combined_rec)md; collar_k5_rec m = new collar_k5_rec(); byte[] b = new byte[INCC.MAX_ITEM_TYPE_LENGTH]; char[] a = se.material.ToCharArray(0, Math.Min(se.material.Length, INCC.MAX_ITEM_TYPE_LENGTH)); Encoding.ASCII.GetBytes(a, 0, a.Length, b, 0); TransferUtils.Copy(b, m.collar_k5_item_type); CopyTuples(imr.k5.k5, m.collar_k5, m.collar_k5_err, INCC.MAX_COLLAR_K5_PARAMETERS); TransferUtils.CopyBoolsToInts(imr.k5.k5_checkbox, m.collar_k5_checkbox); m.collar_k5_mode = (byte)(imr.k5.k5_mode ? 1 : 0); byte[] bb = new byte[INCC.MAX_COLLAR_K5_PARAMETERS * INCC.MAX_K5_LABEL_LENGTH]; int indx = 0; for (int i = 0; i < INCC.MAX_COLLAR_K5_PARAMETERS; i++) { char[] aa = imr.k5.k5_label[i].ToCharArray(0, Math.Min(imr.k5.k5_label[i].Length, INCC.MAX_K5_LABEL_LENGTH)); Encoding.ASCII.GetBytes(aa, 0, aa.Length, bb, indx); indx += INCC.MAX_K5_LABEL_LENGTH; } TransferUtils.Copy(bb, 0, m.collar_k5_label, 0, INCC.MAX_COLLAR_K5_PARAMETERS * INCC.MAX_K5_LABEL_LENGTH); return m; }
unsafe void CollarK5(INCCAnalysisParams.collar_combined_rec combined, collar_k5_rec collar_k5, ushort bonk) { combined.k5 = new INCCAnalysisParams.collar_k5_rec(); combined.k5.k5_mode = (collar_k5.collar_k5_mode != 0 ? true: false); combined.k5.k5_item_type = TransferUtils.str(collar_k5.collar_k5_item_type, INCC.MAX_ITEM_TYPE_LENGTH); combined.k5.k5 = Copy(collar_k5.collar_k5, collar_k5.collar_k5_err, INCC.MAX_COLLAR_K5_PARAMETERS); combined.k5.k5_checkbox = TransferUtils.Copy(collar_k5.collar_k5_checkbox,INCC.MAX_COLLAR_K5_PARAMETERS); for (int i = 0; i < INCC.MAX_COLLAR_K5_PARAMETERS; i++) { int index = i * INCC.MAX_K5_LABEL_LENGTH; combined.k5.k5_label[i] = TransferUtils.str(collar_k5.collar_k5_label + index, INCC.MAX_K5_LABEL_LENGTH); } mlogger.TraceEvent(LogLevels.Verbose, 34214, " -- Collar k5 has mode {0} and is ready to be bonked", combined.k5.k5_mode); }