lib/parser/commands/LoadspriteCommand.js
function LoadspriteCommand(args) {
    var parsed = new statements.ArgumentStatement(args);

    if (parsed.args.length < 2) throw new SyntaxError('LOADSPRITE command requires 2 arguments');
    else if (parsed.args.length > 2 && parsed.args.length < 5) throw new SyntaxError('LOADSPRITE command requires 5 arguments');

    this.id = parsed.args[0];

    if (parsed.args.length > 2) {
        this.x1 = parsed.args[1];
        this.y1 = parsed.args[2];
        this.x2 = parsed.args[3];
        this.y2 = parsed.args[4];
    } else {
        this.fileName = parsed.args[1];
    }
}
function LoadspriteCommand(args) {
    var parsed = new statements.ArgumentStatement(args);

    if (parsed.args.length < 2) throw new SyntaxError('LOADSPRITE command requires 2 arguments');
    else if (parsed.args.length > 2 && parsed.args.length < 5) throw new SyntaxError('LOADSPRITE command requires 5 arguments');

    this.id = parsed.args[0];

    if (parsed.args.length > 2) {
        this.x1 = parsed.args[1];
        this.y1 = parsed.args[2];
        this.x2 = parsed.args[3];
        this.y2 = parsed.args[4];
    } else {
        this.fileName = parsed.args[1];
    }
}
function LoadspriteCommand ( args ) { var parsed = new statements . ArgumentStatement ( args ) ; if ( parsed . args . length < 2 ) throw new SyntaxError ( 'LOADSPRITE command requires 2 arguments' ) ; else if ( parsed . args . length > 2 && parsed . args . length < 5 ) throw new SyntaxError ( 'LOADSPRITE command requires 5 arguments' ) ; this . id = parsed . args [ 0 ] ; if ( parsed . args . length > 2 ) { this . x1 = parsed . args [ 1 ] ; this . y1 = parsed . args [ 2 ] ; this . x2 = parsed . args [ 3 ] ; this . y2 = parsed . args [ 4 ] ; } else { this . fileName = parsed . args [ 1 ] ; } }
Loads a sprite from a file

@param {String} args The arguments to the command
@constructor
Loads a sprite from a file