goog.provide('FlappObject');

goog.scope(function() {

/**
 * @constructor
 */
FlappObject = function(defineTag, movieClip, placeTag) {
    ;
};

// object factory

FlappObject.factory = function(movieClip, name, defineTag, placeTag, dict) {
//     console.log("FlappObject.factory(movieClip, name:"+name+", defineTag, placeTag, dict)");
    var obj;
    var matrix = placeTag.matrix;
    var colorTransform = placeTag.colorTransform;
    switch (defineTag.code) {
    case 2: // DefineShape
    case 22: // DefineShape2
    case 32: // DefineShape3
        obj = new FlappShape(movieClip, matrix, colorTransform);
        obj.loadShapeTag(defineTag, dict);
        break;
    case 39: // DefineSprite
        obj = new FlappMovieClip(movieClip, matrix, colorTransform);
        obj.setControlTags(defineTag.controlTags);
        break;
    default:
        console.error("Not implemented yet defineTag.code="+defineTag.code);
    }
    console.debug(obj);
    obj.code = defineTag.code;
    obj.name = placeTag.name;
    return obj;
};

});
