hexonaut / haxe-phaser

Haxe externs for Phaser.
MIT License
51 stars 9 forks source link

The Easing class has duplicated field declaration (Out function) #7

Closed plicatibu closed 10 years ago

plicatibu commented 10 years ago

The script that converts JS into Haxe code didn't noticed that each Out function is inside a namespace.

The Easing.hx content:

package phaser.tween;

@:native("Phaser.Easing.Bounce")
extern class Easing {
    function In  (k:Float):Float;
    function Out  (k:Float):Float;
    function InOut (k:Float):Float;
    function Out (k:Float):Float;
}

In the original file (Easing.js) one has two functions with identical signatures but different implementations (I'm showing the bare minimum)

Quadratic: {
        /**
        * Ease-out.
        *
        * @method Phaser.Easing.Quadratic#Out
        * @param {number} k - The value to be tweened.
        * @returns {number} k* (2-k).
        */
        Out: function ( k ) {

            return k * ( 2 - k );

        },
    },

    Cubic: {
        /**
        * Cubic ease-out.
        *
        * @method Phaser.Easing.Cubic#Out
        * @param {number} k - The value to be tweened.
        * @returns {number} The tweened value.
        */
        Out: function ( k ) {

            return --k * k * k + 1;

        },
    },

It causes 2 compile errors:

phaser.tween.Class<Easing> has no field Quadratic
Duplicate class field declaration : Out
hexonaut commented 10 years ago

This seems to fixed for whatever reason.