Fix more JsDocs numbers/bools/strings

This was SVN commit r23992.
This commit is contained in:
bb 2020-08-24 11:50:31 +00:00
parent 3ff65b451f
commit 0a26c55513
13 changed files with 44 additions and 44 deletions

View File

@ -36,8 +36,8 @@ class DamageTypesMetadata
} }
/** /**
* @param {String[]} damageTypes - The damageTypes to sort. * @param {string[]} damageTypes - The damageTypes to sort.
* @returns {String[]} - The damageTypes in sorted order; first the ones * @returns {string[]} - The damageTypes in sorted order; first the ones
* where metadata is provided, then the rest. * where metadata is provided, then the rest.
*/ */
sort(damageTypes) sort(damageTypes)

View File

@ -3,8 +3,8 @@
* constructing a polynomial of degree three that goes through all points. * constructing a polynomial of degree three that goes through all points.
* Computes a cardinal or Catmull-Rom spline. * Computes a cardinal or Catmull-Rom spline.
* *
* @param {Number} tension - determines how sharply the curve bends at the given points. * @param {number} tension - determines how sharply the curve bends at the given points.
* @param {Number} x - Location of the point to interpolate, relative to p1 * @param {number} x - Location of the point to interpolate, relative to p1
*/ */
function cubicInterpolation(tension, x, p0, p1, p2, p3) function cubicInterpolation(tension, x, p0, p1, p2, p3)
{ {

View File

@ -167,7 +167,7 @@ function getUsernameList()
* Execute a command locally. Requires addChatMessage. * Execute a command locally. Requires addChatMessage.
* *
* @param {string} input * @param {string} input
* @returns {Boolean} whether a command was executed * @returns {boolean} whether a command was executed
*/ */
function executeNetworkCommand(input) function executeNetworkCommand(input)
{ {

View File

@ -342,7 +342,7 @@ function translateAIName(aiName)
/** /**
* Returns title or placeholder. * Returns title or placeholder.
* *
* @param {Number} index - index of AIDifficulties * @param {number} index - index of AIDifficulties
*/ */
function translateAIDifficulty(index) function translateAIDifficulty(index)
{ {
@ -376,7 +376,7 @@ function translateMapType(mapType)
/** /**
* Returns title or placeholder "Default". * Returns title or placeholder "Default".
* *
* @param {Number} mapSize - tilecount * @param {number} mapSize - tilecount
* @returns {string} * @returns {string}
*/ */
function translateMapSize(tiles) function translateMapSize(tiles)
@ -388,7 +388,7 @@ function translateMapSize(tiles)
/** /**
* Returns title or placeholder. * Returns title or placeholder.
* *
* @param {Number} population * @param {number} population
* @param {boolean} world - Whether the entry has world population enabled. * @param {boolean} world - Whether the entry has world population enabled.
* @returns {string} * @returns {string}
*/ */

View File

@ -720,7 +720,7 @@ function updateGroups()
/** /**
* Toggles the display of status bars for all of the player's entities. * Toggles the display of status bars for all of the player's entities.
* *
* @param {Boolean} remove - Whether to hide all previously shown status bars. * @param {boolean} remove - Whether to hide all previously shown status bars.
*/ */
function recalculateStatusBarDisplay(remove = false) function recalculateStatusBarDisplay(remove = false)
{ {

View File

@ -35,8 +35,8 @@ function getMinAndMaxHeight(heightmap = g_Map.height)
/** /**
* Rescales a heightmap so its minimum and maximum height is as the arguments told preserving it's global shape * Rescales a heightmap so its minimum and maximum height is as the arguments told preserving it's global shape
* @param {Number} [minHeight=MIN_HEIGHT] - Minimum height that should be used for the resulting heightmap * @param {number} [minHeight=MIN_HEIGHT] - Minimum height that should be used for the resulting heightmap
* @param {Number} [maxHeight=MAX_HEIGHT] - Maximum height that should be used for the resulting heightmap * @param {number} [maxHeight=MAX_HEIGHT] - Maximum height that should be used for the resulting heightmap
* @param {array} [heightmap=g_Map.height] - A reliefmap * @param {array} [heightmap=g_Map.height] - A reliefmap
* @todo Add preserveCostline to leave a certain height untoucht and scale below and above that seperately * @todo Add preserveCostline to leave a certain height untoucht and scale below and above that seperately
*/ */
@ -53,7 +53,7 @@ function rescaleHeightmap(minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, height
* Translates the heightmap by the given vector, i.e. moves the heights in that direction. * Translates the heightmap by the given vector, i.e. moves the heights in that direction.
* *
* @param {Vector2D} offset - A vector indicating direction and distance. * @param {Vector2D} offset - A vector indicating direction and distance.
* @param {Number} [defaultHeight] - The elevation to be set for vertices that don't have a corresponding location on the source heightmap. * @param {number} [defaultHeight] - The elevation to be set for vertices that don't have a corresponding location on the source heightmap.
* @param {Array} [heightmap=g_Map.height] - A reliefmap * @param {Array} [heightmap=g_Map.height] - A reliefmap
*/ */
function translateHeightmap(offset, defaultHeight = undefined, heightmap = g_Map.height) function translateHeightmap(offset, defaultHeight = undefined, heightmap = g_Map.height)
@ -78,7 +78,7 @@ function translateHeightmap(offset, defaultHeight = undefined, heightmap = g_Map
* Get start location with the largest minimum distance between players * Get start location with the largest minimum distance between players
* @param {Object} [heightRange] - The height range start locations are allowed * @param {Object} [heightRange] - The height range start locations are allowed
* @param {integer} [maxTries=1000] - How often random player distributions are rolled to be compared * @param {integer} [maxTries=1000] - How often random player distributions are rolled to be compared
* @param {Number} [minDistToBorder=20] - How far start locations have to be away from the map border * @param {number} [minDistToBorder=20] - How far start locations have to be away from the map border
* @param {integer} [numberOfPlayers=g_MapSettings.PlayerData.length] - How many start locations should be placed * @param {integer} [numberOfPlayers=g_MapSettings.PlayerData.length] - How many start locations should be placed
* @param {array} [heightmap=g_Map.height] - The reliefmap for the start locations to be placed on * @param {array} [heightmap=g_Map.height] - The reliefmap for the start locations to be placed on
* @param {boolean} [isCircular=g_MapSettings.CircularMap] - If the map is circular or rectangular * @param {boolean} [isCircular=g_MapSettings.CircularMap] - If the map is circular or rectangular
@ -135,10 +135,10 @@ function getStartLocationsByHeightmap(heightRange, maxTries = 1000, minDistToBor
* @note min/maxHeight will not necessarily be present in the heightmap * @note min/maxHeight will not necessarily be present in the heightmap
* @note On circular maps the edges (given by initialHeightmap) may not be in the playable map area * @note On circular maps the edges (given by initialHeightmap) may not be in the playable map area
* @note The impact of the initial heightmap depends on its size and target map size * @note The impact of the initial heightmap depends on its size and target map size
* @param {Number} [minHeight=MIN_HEIGHT] - Lower limit of the random height to be rolled * @param {number} [minHeight=MIN_HEIGHT] - Lower limit of the random height to be rolled
* @param {Number} [maxHeight=MAX_HEIGHT] - Upper limit of the random height to be rolled * @param {number} [maxHeight=MAX_HEIGHT] - Upper limit of the random height to be rolled
* @param {array} [initialHeightmap] - Optional, Small (e.g. 3x3) heightmap describing the global shape of the map e.g. an island [[MIN_HEIGHT, MIN_HEIGHT, MIN_HEIGHT], [MIN_HEIGHT, MAX_HEIGHT, MIN_HEIGHT], [MIN_HEIGHT, MIN_HEIGHT, MIN_HEIGHT]] * @param {array} [initialHeightmap] - Optional, Small (e.g. 3x3) heightmap describing the global shape of the map e.g. an island [[MIN_HEIGHT, MIN_HEIGHT, MIN_HEIGHT], [MIN_HEIGHT, MAX_HEIGHT, MIN_HEIGHT], [MIN_HEIGHT, MIN_HEIGHT, MIN_HEIGHT]]
* @param {Number} [smoothness=0.5] - Float between 0 (rough, more local structures) to 1 (smoother, only larger scale structures) * @param {number} [smoothness=0.5] - Float between 0 (rough, more local structures) to 1 (smoother, only larger scale structures)
* @param {array} [heightmap=g_Map.height] - The reliefmap that will be set by this function * @param {array} [heightmap=g_Map.height] - The reliefmap that will be set by this function
*/ */
function setBaseTerrainDiamondSquare(minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, initialHeightmap = undefined, smoothness = 0.5, heightmap = g_Map.height) function setBaseTerrainDiamondSquare(minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, initialHeightmap = undefined, smoothness = 0.5, heightmap = g_Map.height)

View File

@ -133,16 +133,16 @@ function createDecoration(objects, counts, constraint)
* Do determine the position, it picks a random point on the land, find the closest, significantly large body of water, * Do determine the position, it picks a random point on the land, find the closest, significantly large body of water,
* then places the dock at the first point close to that body of water within the given heightrange. * then places the dock at the first point close to that body of water within the given heightrange.
* *
* @param {String} template - The template name of the dock to be placed. * @param {string} template - The template name of the dock to be placed.
* @param {Number} playerID - The owner of the dock. * @param {number} playerID - The owner of the dock.
* @param {Number} count - The number of docks to be placed. * @param {number} count - The number of docks to be placed.
* @param {Object} tileClassWater - The tileclass the water area is marked with. * @param {Object} tileClassWater - The tileclass the water area is marked with.
* @param {Object} tileClassDock - The dock position is marked with this class. * @param {Object} tileClassDock - The dock position is marked with this class.
* @param {Number} heightMin - The lowest height a dock could be placed. * @param {number} heightMin - The lowest height a dock could be placed.
* @param {Number} heightMax - The greatest height a dock could be placed. * @param {number} heightMax - The greatest height a dock could be placed.
* @param {Array|Constraint} constraints - Only consider dock positions valid that meet this Constraint. * @param {Array|Constraint} constraints - Only consider dock positions valid that meet this Constraint.
* @param {Number} offset - How many tiles to move the dock towards the direction of the water after having found a location. * @param {number} offset - How many tiles to move the dock towards the direction of the water after having found a location.
* @param {Number} retryFactor- How many different locations should be tested. * @param {number} retryFactor- How many different locations should be tested.
*/ */
function placeDocks(template, playerID, count, tileClassWater, tileClassDock, heightMin, heightMax, constraints, offset, retryFactor) function placeDocks(template, playerID, count, tileClassWater, tileClassDock, heightMin, heightMax, constraints, offset, retryFactor)
{ {

View File

@ -1,7 +1,7 @@
/** /**
* @file The RandomMap stores the elevation grid, terrain textures and entities that are exported to the engine. * @file The RandomMap stores the elevation grid, terrain textures and entities that are exported to the engine.
* *
* @param {Number} baseHeight - Initial elevation of the map * @param {number} baseHeight - Initial elevation of the map
* @param {String|Array} baseTerrain - One or more texture names * @param {String|Array} baseTerrain - One or more texture names
*/ */
function RandomMap(baseHeight, baseTerrain) function RandomMap(baseHeight, baseTerrain)

View File

@ -4,8 +4,8 @@
* The heightrange is either scaled proportionally or mapped to the given heightrange. * The heightrange is either scaled proportionally or mapped to the given heightrange.
* *
* @param {Uint16Array} heightmap - One dimensional array of vertex heights. * @param {Uint16Array} heightmap - One dimensional array of vertex heights.
* @param {Number} [normalMinHeight] - The minimum height the elevation grid of 320 tiles would have. * @param {number} [normalMinHeight] - The minimum height the elevation grid of 320 tiles would have.
* @param {Number} [normalMaxHeight] - The maximum height the elevation grid of 320 tiles would have. * @param {number} [normalMaxHeight] - The maximum height the elevation grid of 320 tiles would have.
*/ */
function HeightmapPainter(heightmap, normalMinHeight = undefined, normalMaxHeight = undefined) function HeightmapPainter(heightmap, normalMinHeight = undefined, normalMaxHeight = undefined)
{ {

View File

@ -1,8 +1,8 @@
/** /**
* Paints the given texture-mapping to the given tiles. * Paints the given texture-mapping to the given tiles.
* *
* @param {String[]} textureIDs - Names of the terrain textures * @param {string[]} textureIDs - Names of the terrain textures
* @param {Number[]} textureNames - One-dimensional array of indices of texturenames, one for each tile of the entire map. * @param {number[]} textureNames - One-dimensional array of indices of texturenames, one for each tile of the entire map.
* @returns * @returns
*/ */
function TerrainTextureArrayPainter(textureIDs, textureNames) function TerrainTextureArrayPainter(textureIDs, textureNames)

View File

@ -357,11 +357,11 @@ TriggerHelper.HasDealtWithTech = function(playerID, techName)
/** /**
* Returns all names of templates that match the given identity classes, constrainted to an optional civ. * Returns all names of templates that match the given identity classes, constrainted to an optional civ.
* *
* @param {String} classes - See MatchesClassList for the accepted formats, for example "Class1 Class2+!Class3". * @param {string} classes - See MatchesClassList for the accepted formats, for example "Class1 Class2+!Class3".
* @param [String] civ - Optionally only retrieve templates of the given civ. Can be left undefined. * @param [string] civ - Optionally only retrieve templates of the given civ. Can be left undefined.
* @param [String] packedState - When retrieving siege engines filter for the "packed" or "unpacked" state * @param [string] packedState - When retrieving siege engines filter for the "packed" or "unpacked" state
* @param [String] rank - If given, only return templates that have no or the given rank. For example "Elite". * @param [string] rank - If given, only return templates that have no or the given rank. For example "Elite".
* @param [Boolean] excludeBarracksVariants - Optionally exclude templates whose name ends with "_barracks" * @param [boolean] excludeBarracksVariants - Optionally exclude templates whose name ends with "_barracks"
*/ */
TriggerHelper.GetTemplateNamesByClasses = function(classes, civ, packedState, rank, excludeBarracksVariants) TriggerHelper.GetTemplateNamesByClasses = function(classes, civ, packedState, rank, excludeBarracksVariants)
{ {
@ -397,8 +397,8 @@ TriggerHelper.GetTemplateNamesByClasses = function(classes, civ, packedState, ra
/** /**
* Composes a random set of the given templates of the given total size. * Composes a random set of the given templates of the given total size.
* *
* @param {String[]} templateNames - for example ["brit_infantry_javelineer_b", "brit_cavalry_swordsman_e"] * @param {string[]} templateNames - for example ["brit_infantry_javelineer_b", "brit_cavalry_swordsman_e"]
* @param {Number} totalCount - total amount of templates, in this example 12 * @param {number} totalCount - total amount of templates, in this example 12
* @returns an object where the keys are template names and values are amounts, * @returns an object where the keys are template names and values are amounts,
* for example { "brit_infantry_javelineer_b": 4, "brit_cavalry_swordsman_e": 8 } * for example { "brit_infantry_javelineer_b": 4, "brit_cavalry_swordsman_e": 8 }
*/ */
@ -436,7 +436,7 @@ TriggerHelper.RandomTemplateComposition = function(templateNames, totalCount)
* { "templates": ["template3"], "frequency": 1 }, * { "templates": ["template3"], "frequency": 1 },
* { "templates": ["hero1", "hero2"], "unique_entities": [380, 495], "count": 1 } * { "templates": ["hero1", "hero2"], "unique_entities": [380, 495], "count": 1 }
* ] * ]
* @param {Number} totalCount - total amount of templates, for example 5. * @param {number} totalCount - total amount of templates, for example 5.
* *
* @returns an object where the keys are template names and values are amounts, * @returns an object where the keys are template names and values are amounts,
* for example { "template1": 1, "template2": 3, "template3": 2, "hero1": 1 } * for example { "template1": 1, "template2": 3, "template3": 2, "hero1": 1 }

View File

@ -211,7 +211,7 @@ TechnologyManager.prototype.OnGlobalOwnershipChanged = function(msg)
* Marks a technology as researched. * Marks a technology as researched.
* Note that this does not verify that the requirements are met. * Note that this does not verify that the requirements are met.
* *
* @param {String} tech - The technology to mark as researched. * @param {string} tech - The technology to mark as researched.
*/ */
TechnologyManager.prototype.ResearchTechnology = function(tech) TechnologyManager.prototype.ResearchTechnology = function(tech)
{ {

View File

@ -295,10 +295,10 @@ Trigger.prototype.OnGlobalDiplomacyChanged = function(msg)
/** /**
* Execute a function after a certain delay. * Execute a function after a certain delay.
* *
* @param {Number} time - Delay in milliseconds. * @param {number} time - Delay in milliseconds.
* @param {String} action - Name of the action function. * @param {string} action - Name of the action function.
* @param {Object} data - Arbitrary object that will be passed to the action function. * @param {Object} data - Arbitrary object that will be passed to the action function.
* @return {Number} The ID of the timer, so it can be stopped later. * @return {number} The ID of the timer, so it can be stopped later.
*/ */
Trigger.prototype.DoAfterDelay = function(time, action, data) Trigger.prototype.DoAfterDelay = function(time, action, data)
{ {
@ -312,12 +312,12 @@ Trigger.prototype.DoAfterDelay = function(time, action, data)
/** /**
* Execute a function each time a certain delay has passed. * Execute a function each time a certain delay has passed.
* *
* @param {Number} interval - Interval in milleseconds between consecutive calls. * @param {number} interval - Interval in milleseconds between consecutive calls.
* @param {String} action - Name of the action function. * @param {string} action - Name of the action function.
* @param {Object} data - Arbitrary object that will be passed to the action function. * @param {Object} data - Arbitrary object that will be passed to the action function.
* @param {Number} [start] - Optional initial delay in milleseconds before starting the calls. * @param {number} [start] - Optional initial delay in milleseconds before starting the calls.
* If not given, interval will be used. * If not given, interval will be used.
* @return {Number} the ID of the timer, so it can be stopped later. * @return {number} the ID of the timer, so it can be stopped later.
*/ */
Trigger.prototype.DoRepeatedly = function(time, action, data, start) Trigger.prototype.DoRepeatedly = function(time, action, data, start)
{ {