"use strict";
cc._RF.push(module, '00263T7laVN95RGVehPOXFi', 'pbhelper');
// Script/pbhelper.js

'use strict';

var protobuf = require("protobufjs");
var builder = protobuf.newBuilder();

var protoFiles = ['test_Proto.proto'];

function PBHelper() {
    this.sequence = 0;
}

PBHelper.prototype = {
    loadFile: function loadFile(path, packageName) {
        if (typeof cc !== 'undefined') {
            path = cc.sys.isNative ? cc.url.raw(path) : 'res/raw-assets/' + path;
            protobuf.Util.IS_NODE = cc.sys.isNative;
            cc.log('>>>>>>>' + path);
        }

        builder.importRoot = path;
        protoFiles.forEach(function (fileName) {
            var filePath = path + '/' + fileName;
            protobuf.protoFromFile(filePath, builder);
        });

        return builder.build(packageName);
    }

};

module.exports = PBHelper;

cc._RF.pop();