|
| 1 | +JSDOC3 Work: |
| 2 | + |
| 3 | +1) This should go at the top of every file (with the module name corrected) |
| 4 | + |
| 5 | +/** |
| 6 | +* @author Richard Davey <rich@photonstorm.com> |
| 7 | +* @copyright 2013 Photon Storm Ltd. |
| 8 | +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License |
| 9 | +* @module Phaser.Animation |
| 10 | +*/ |
| 11 | + |
| 12 | +2) This is the format a constructor should be: |
| 13 | + |
| 14 | +/** |
| 15 | +* The constructor description goes here. If there isn't one for you to paste in, just put TODO. |
| 16 | +* |
| 17 | +* @class Phaser.Animation |
| 18 | +* @constructor |
| 19 | +* @param {Phaser.Game} game - A reference to the currently running game. |
| 20 | +* @param {Phaser.Sprite} parent - A reference to the owner of this Animation. |
| 21 | +* @param {string} name - The unique name for this animation, used in playback commands. |
| 22 | +* @param {Phaser.Animation.FrameData} frameData - The FrameData object that contains all frames used by this Animation. |
| 23 | +* @param {(Array.<number>|Array.<string>)} frames - An array of numbers or strings indicating which frames to play in which order. |
| 24 | +* @param {number} delay - The time between each frame of the animation, given in ms. |
| 25 | +* @param {boolean} looped - Should this animation loop or play through once. |
| 26 | +*/ |
| 27 | + |
| 28 | +You must ensure the class is correct and it has the @constructor tag. |
| 29 | +It is important you include the data-type. I don't expect you to know what the data type is, so just include: {todo} |
| 30 | +It is important you include the hypen after the parameter name. You will always know what the parameter name is, so it should always be included. |
| 31 | +You often won't know what the parameter description is, so just put "todo", like this: |
| 32 | + |
| 33 | +* @param {todo} name - todo. |
| 34 | + |
| 35 | +3) Functions are nearly exactly the same as the constructor: |
| 36 | + |
| 37 | +/** |
| 38 | +* The function description goes here. If there isn't one for you to paste in, just put TODO. |
| 39 | +* |
| 40 | +* @method play |
| 41 | +* @param {Number} [frameRate=null] The framerate to play the animation at. |
| 42 | +* @return {Phaser.Animation} A reference to this Animation instance. |
| 43 | +*/ |
| 44 | + |
| 45 | +You must ensure the @method tag is correct and present. |
| 46 | +It is important you include the data-type. I don't expect you to know what the data type is, so just include: {todo} |
| 47 | +It is important you include the hypen after the parameter name. You will always know what the parameter name is, so it should always be included. |
| 48 | +You often won't know what the parameter description is, so just put "todo", like this: |
| 49 | + |
| 50 | +* @param {todo} name - todo. |
| 51 | + |
| 52 | +4) All properties must be marked-up: |
| 53 | + |
| 54 | +/** |
| 55 | +* @property {boolean} isFinished - The finished state of the Animation. Set to true once playback completes, false during playback. |
| 56 | +* @default |
| 57 | +*/ |
| 58 | +this.isFinished = false; |
| 59 | + |
| 60 | +It is important you include the data-type. I don't expect you to know what the data type is, so just include: {todo} |
| 61 | +It is important you include the hypen after the parameter name. You will always know what the parameter name is, so it should always be included. |
| 62 | +You often won't know what the parameter description is, so just put "todo", like this: |
| 63 | + |
| 64 | +* @property {todo} isFinished - todo. |
| 65 | + |
| 66 | +If the property has a base value assigned to it (i.e. a number or a string) then put @default. |
| 67 | +If the property starts with an underscore it must include @private. Here is an example combining the two: |
| 68 | + |
| 69 | +/** |
| 70 | +* @property {number} _frameIndex - The index of the current frame. |
| 71 | +* @private |
| 72 | +* @default |
| 73 | +*/ |
| 74 | +this._frameIndex = 0; |
0 commit comments