// Detect It Easy: detection rule file
// Author: BJNFNE <bjnfne@web.de>
// Original location to look at is "'OBC Copyright MDO 1999"' since OBCEditor (https://github.com/BJNFNE/DEV7/blob/master/tools/OBCEditor/OBCEditor.py)
// updates the copyright year from the systemtime it wouldn't match with the old 1999 hardcoded variant.
// OBC is an compiled scripting language which get compiled to their OBC script.

// https://wiki.scummvm.org/index.php?title=Gob/DEV7_Information#STK21/OBC
meta("format", "Compiled DEV7 object (.OBC)");

function detect() {
    if (Binary.compare("'OBC Copyright MDO'20")) {
        var copyrightYear = Binary.getString(18, 5).trim();

        if (/^[12]\d{3}$/.test(copyrightYear)) {
            sVersion = copyrightYear;
            sOptions = File.cleanString(Binary.getString(0x0054, 14));
            bDetected = true;
        }
    }

    return result();
}