Skip to content

Commit

Permalink
Fix Type Annotations and Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LengthenedGradient committed Apr 12, 2024
1 parent 0765f33 commit deab3bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lua/acf/core/classes/grouped.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local Classes = ACF.Classes
--- @param ID string The ID of the group
--- @param Destiny table The table to store the group in
--- @param Data table The data of the group
--- @return table Group The created group
--- @return table | nil Group The created group
function Classes.AddGroup(ID, Destiny, Data)
if not isstring(ID) then return end
if not istable(Destiny) then return end
Expand Down Expand Up @@ -41,7 +41,7 @@ end
--- @param GroupID string The ID of the group previously created using Class.AddGroup
--- @param Destiny string The table to store the group item in (should be the same as the group)
--- @param Data table The data of the group item
--- @return table Class The created group item
--- @return table | nil Class The created group item
function Classes.AddGroupItem(ID, GroupID, Destiny, Data)
if not isstring(ID) then return end
if not isstring(GroupID) then return end
Expand Down Expand Up @@ -73,8 +73,8 @@ function Classes.AddGroupItem(ID, GroupID, Destiny, Data)
return Class
end

--- Gets a group or group item given its ID and the namespace it's stored in
--- @param Namespace string The table to store the group in
--- Gets a group given its ID and the namespace it's stored in
--- @param Namespace string The namespace to lookup the group in
--- @param ID string The ID of the group
--- @return table | nil # The group or group item if found
function Classes.GetGroup(Namespace, ID)
Expand All @@ -95,7 +95,7 @@ function Classes.GetGroup(Namespace, ID)
end

--- Indexes the groups stored in Entries into a new Namespace, with helper functions
--- @param Namespace table The namespace to store the groups under
--- @param Namespace table The table that will receive the new functions
--- @param Entries table The table storing groups
function Classes.AddGroupedFunctions(Namespace, Entries)
if not istable(Namespace) then return end
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/core/classes/object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end
--- @param ID string The ID of the new sub class to add
--- @param Base string The ID of the base class the sub class will inherit from
--- @param Destiny table A table that the new object will be indexed into, with the ID as key
--- @return table # The created object
--- @return table | nil # The created object
function Classes.AddObject(ID, Base, Destiny)
if not isstring(ID) then return end
if not istable(Destiny) then return end
Expand Down
6 changes: 3 additions & 3 deletions lua/acf/core/classes/simple.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ local istable = istable
local Classes = ACF.Classes

--- Registers a simple class
--- Similar to Classes.AddObject
--- Similar to Classes.AddObject, except more intended to purely store data (e.g. fuel types) (try not to put methods in these).
--- @param ID string The ID of the simple class to add
--- @param Destiny table The table to store the simple class in
--- @param Data table The data of the simple class
--- @return table Class The created simple class
--- @return table | nil Class The created simple class
function Classes.AddSimple(ID, Destiny, Data)
if not isstring(ID) then return end
if not istable(Destiny) then return end
Expand All @@ -35,7 +35,7 @@ function Classes.AddSimple(ID, Destiny, Data)
end

--- Indexes the simple classes stored in Entries into a new Namespace, with helper functions
--- @param Namespace table The namespace to store the simple classes under
--- @param Namespace table The table that will receive the new functions
--- @param Entries table The table storing simple classes
function Classes.AddSimpleFunctions(Namespace, Entries)
if not istable(Namespace) then return end
Expand Down

0 comments on commit deab3bc

Please sign in to comment.