protected override int GetSize() { var totalSize = 4; // Header foreach (var agentLabAddition in agentLabAdditionsList) { totalSize += 4; if (agentLabAddition.scriptCommandsAmount > 0) { totalSize += agentLabAddition.scriptCommand.GetLength(); } totalSize += 2; } totalSize += scriptCommand.GetLength(); return(totalSize); }
protected override int GetSize() { int oldSize = size; size = 0; size += 4; size += 8; size += 4; size += Name.Length; //size += 4; size += UI32.Count * 4; //size += 4; size += OGIs.Count * 2; //size += 4; size += Anims.Count * 2; //size += 4; size += Scripts.Count * 2; //size += 4; size += Objects.Count * 2; //size += 4; size += Sounds.Count * 2; if ((UnkBitfield & 0x20000000) != 0x0) { size += 4; // PHeader size += 4; // UnkInt //size += 4; size += instFlagsList.Count * 4; //size += 4; size += instFloatsList.Count * 4; //size += 4; size += instIntegerList.Count * 4; } updateFlag(); if ((UnkBitfield & 0x40000000) != 0x0) { size += 4; // Flag if ((flag & 0x00000001) != 0) { size += 4; size += cObjects.Count * 2; } if ((flag & 0x00000002) != 0) { size += 4; size += cOGIs.Count * 2; } if ((flag & 0x00000004) != 0) { size += 4; size += cAnims.Count * 2; } if ((flag & 0x00000008) != 0) { size += 4; size += cCM.Count * 2; } if ((flag & 0x00000010) != 0) { size += 4; size += cScripts.Count * 2; } if ((flag & 0x00000020) != 0) { size += 4; size += cUnk.Count * 2; } if ((flag & 0x00000040) != 0) { size += 4; size += cSounds.Count * 2; } } size += 4; // Amount of script commands if (scriptCommand != null) { size += scriptCommand.GetLength(); } return(size); }