phaser/src/physics/impact/components/CheckAgainst.js

116 lines
2.2 KiB
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
2017-08-15 22:36:00 +00:00
var TYPE = require('../TYPE');
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.CheckAgainst
* @since 3.0.0
*/
2017-08-15 22:36:00 +00:00
var CheckAgainst = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB
* @since 3.0.0
*
* @return {[type]} [description]
*/
2017-08-16 21:10:19 +00:00
setAvsB: function ()
{
this.setTypeA();
return this.setCheckAgainstB();
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA
* @since 3.0.0
*
* @return {[type]} [description]
*/
2017-08-16 21:10:19 +00:00
setBvsA: function ()
{
this.setTypeB();
return this.setCheckAgainstA();
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone
* @since 3.0.0
*
* @return {[type]} [description]
*/
2017-08-15 22:36:00 +00:00
setCheckAgainstNone: function ()
{
this.body.checkAgainst = TYPE.NONE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA
* @since 3.0.0
*
* @return {[type]} [description]
*/
2017-08-15 22:36:00 +00:00
setCheckAgainstA: function ()
{
this.body.checkAgainst = TYPE.A;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB
* @since 3.0.0
*
* @return {[type]} [description]
*/
2017-08-15 22:36:00 +00:00
setCheckAgainstB: function ()
{
this.body.checkAgainst = TYPE.B;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst
* @type {[type]}
* @since 3.0.0
*/
2017-08-15 22:36:00 +00:00
checkAgainst: {
get: function ()
{
return this.body.checkAgainst;
},
set: function (value)
{
this.body.checkAgainst = value;
}
}
};
module.exports = CheckAgainst;