const GameStatesStatic = require('GameStates');
var BarrierSuperClass = require("BarrierSuper");
cc.Class({
    extends: BarrierSuperClass,

    properties: {

    },
    onCollisionEnter: function (other)
    {
        if(other.node.name === 'PlayerCollisionLine')
        {
            var Level = this.node.parent.parent;
            var Canvas = Level.getComponent('LevelControl').Canvas;
            var GameStates = Canvas.getComponent('GameStates');

            GameStates.CurrentProgress = GameStatesStatic.GameProgress.Race;
            // cc.log('race='+GameStates.CurrentProgress);
        }
    },
    CollisionEnter: function (other)
    {
        if(other.node.name === 'PlayerCollisionLine')
        {
            var Level = this.node.parent.parent;
            var Canvas = Level.getComponent('LevelControl').Canvas;
            var GameStates = Canvas.getComponent('GameStates');

            GameStates.CurrentProgress = GameStatesStatic.GameProgress.Race;
            // cc.log('race='+GameStates.CurrentProgress);
            cc.find('Canvas').getComponent('GameStates').strCureentLevel = 'Sprint';
        }
    },
});
