public CR2WChunk Copy(CR2WCopyAction context) { // this one was already copied if (context.chunkTranslation.ContainsKey(ChunkIndex)) { return(null); } var chunk = context.DestinationFile.CreateChunk(Type); context.chunks.Add(chunk); context.chunkTranslation.Add(ChunkIndex, chunk.ChunkIndex); chunk.Type = Type; chunk.Flags = Flags; chunk.unk4 = unk4; chunk.crc = crc; // requires updating from context.chunkTranslation once all chunks are copied. chunk.ParentChunkId = ParentChunkId; if (data != null) { chunk.data = (CVector)data.Copy(context); } if (unknownBytes != null) { chunk.unknownBytes = (CBytes)unknownBytes.Copy(context); } return(chunk); }
public override CVariable Copy(CR2WCopyAction context) { var var = (CVariableWrapper)base.Copy(context); var.variable = variable.Copy(context); return(var); }