Skip to content

Commit

Permalink
API - LDoc doesn't understand dynamic function names
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteOne committed Aug 13, 2023
1 parent eb58881 commit 145ba57
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions System/API/Cast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ br.api.cast = function(self,spell,id)
-- @section CastAPIFunctions

---
-- @function br.player.cast.spell
-- @description Creates a function that can be used to cast a spell based on various parameters.
-- @function br.player.cast.[spell]
-- @description Creates a function that can be used to cast a spell based on various parameters. The function name is dynamically generated based on the spell name.
-- For example, for a spell named "thisSpell", the function would be `cast.thisSpell()`.
-- @tparam string thisUnit The target unit for the spell. Can be standard WoW units, dynamic units, or special parameters like "best", "playerGround", etc.
-- @tparam string castType Defines the type of AoE or special cast conditions.
-- @tparam number minUnits Minimum number of units needed to be hit by AoE spell.
Expand Down Expand Up @@ -51,7 +52,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.able.spell
-- @function br.player.cast.able.[spell]
-- @description Checks if a spell can be cast based on various parameters and returns True/False.
-- @tparam string thisUnit The target unit for the spell. Can be standard WoW units, dynamic units, or special parameters.
-- @tparam string castType Defines the type of AoE or special cast conditions.
Expand Down Expand Up @@ -85,7 +86,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.active.spell
-- @function br.player.cast.active.[spell]
-- @description Returns if the spell is the one currently being cast.
-- @tparam string thisUnit The unit to check if it's casting the spell. Can be standard WoW units or dynamic units.
-- @return True/False
Expand All @@ -96,7 +97,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.auto.spell
-- @function br.player.cast.auto.[spell]
-- @description Checks if the spell is set to auto-repeat or if it's the current spell being cast.
-- @return True/False
if cast.auto == nil then cast.auto = {} end
Expand All @@ -105,7 +106,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.cancel.spell
-- @function br.player.cast.cancel.[spell]
-- @description Cancels the current spell being cast if it matches the specified spell.
-- @return True/False
if cast.cancel == nil then cast.cancel = {} end
Expand All @@ -119,7 +120,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.cost.spell
-- @function br.player.cast.cost.[spell]
-- @description Returns the cost of the spell.
-- @tparam boolean altPower Set to "true" to return alternate power cost.
-- @return The cost of the spell.
Expand All @@ -134,7 +135,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.current.spell
-- @function br.player.cast.current.[spell]
-- @description Returns if the spell is the currently cast spell for the target (Alternate to br.player.cast.active.spell()).
-- @tparam string thisUnit Acceptable parameters: nil (defaults to "player"), standard WoW units, or dynamic units.
-- @return True/False
Expand All @@ -155,7 +156,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.dispel.spell
-- @function br.player.cast.dispel.[spell]
-- @description Returns if the spell if capable of dispelling the target.
-- @tparam string thisUnit Acceptable parameters: nil (defaults to "target"), standard WoW units, or dynamic units.
-- @return True/False
Expand All @@ -166,7 +167,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.empowered.spell
-- @function br.player.cast.empowered.[spell]
-- @description Returns current empowered rank of the spell or 0 if not empowered.
-- @return The current empowered rank of the spell.
if cast.empowered == nil then cast.empowered = {} end
Expand All @@ -188,7 +189,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.inFlight.spell
-- @function br.player.cast.inFlight.[spell]
-- @description Returns if the spell is currently in flight to the target.
-- @tparam string thisUnit Acceptable parameters: nil (defaults to "target"), standard WoW units, or dynamic units.
-- @return True/False
Expand All @@ -199,7 +200,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.inFlightRemain.spell
-- @function br.player.cast.inFlightRemain.[spell]
-- @description Returns time remaining on a spell in flight to the target.
-- @tparam string thisUnit The target unit to check for the spell in flight.
-- @return Time remaining on the spell in flight.
Expand All @@ -209,7 +210,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.last.spell
-- @function br.player.cast.last.[spell]
-- @description Returns if the spell was the last one cast or not.
-- @tparam number index Number of last cast spell up to 10 previous spells, default value is 1 if not provided.
-- @return True/False
Expand All @@ -221,7 +222,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.last.time.spell
-- @function br.player.cast.last.time.[spell]
-- @description Returns the GetTime() value the last cast of this spell occurred.
-- @return The last time the spell was cast.
if cast.last.time == nil then cast.last.time = {} end
Expand All @@ -231,7 +232,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.noControl.spell
-- @function br.player.cast.noControl.[spell]
-- @description Returns true if the spell can free you of a "no control" effect.
-- @tparam string thisUnit The target unit to check for the "no control" effect. Defaults to "player" if not provided.
-- @return True/False
Expand Down Expand Up @@ -271,7 +272,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.pool.spell
-- @function br.player.cast.pool.[spell]
-- @description Returns true if specified power requirements are not met.
-- @tparam boolean altPower Set to "true" to return alternate power cost. Defaults to false if not provided.
-- @tparam number specificAmt Set to specified power amount. Defaults to 0 if not provided.
Expand All @@ -289,7 +290,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.range.spell
-- @function br.player.cast.range.[spell]
-- @description Returns the spell's range, if it has one.
-- @return The spell's range.
if cast.range == nil then cast.range = {} end
Expand All @@ -298,7 +299,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.regen.spell
-- @function br.player.cast.regen.[spell]
-- @description Returns the amount of power spell will generate when cast.
-- @return The amount of power spell will generate.
if cast.regen == nil then cast.regen = {} end
Expand All @@ -307,7 +308,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.safe.spell
-- @function br.player.cast.safe.[spell]
-- @description Return if safe to cast specified aoe spell on unit given the aoe dimensions.
-- @tparam string thisUnit The target unit to check for safety. Defaults to "target" if not provided.
-- @tparam string aoeType The type of AoE to check for safety. Can be "rect", "cone", "ground", or "aoe".
Expand All @@ -320,7 +321,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.time.spell
-- @function br.player.cast.time.[spell]
-- @description Return cast time of player's spell. If the spell has no cast time, it returns the global cooldown.
-- @return The cast time of the spell.
if cast.time == nil then cast.time = {} end
Expand All @@ -341,7 +342,7 @@ br.api.cast = function(self,spell,id)
end

---
-- @function br.player.cast.timeSinceLast.spell
-- @function br.player.cast.timeSinceLast.[spell]
-- @description Returns the time since the last cast of this spell occurred.
-- @return The time since the last cast of this spell occurred.
if cast.timeSinceLast == nil then cast.timeSinceLast = {} end
Expand Down

0 comments on commit 145ba57

Please sign in to comment.