Skip to content

Commit

Permalink
Wiki Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bleonheart committed Oct 28, 2024
1 parent 75fc4c3 commit b6f6f1c
Show file tree
Hide file tree
Showing 6 changed files with 536 additions and 122 deletions.
14 changes: 7 additions & 7 deletions lilia/gamemode/core/meta/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ debug.getregistry().Character = lia.meta.character
-- @treturn String A string in the format "character[ID]", where ID is the character's unique identifier.
-- @usage
-- print(lia.char.loaded[1])
-- -- Output: "character[1]"
-- Output: "character[1]"
function characterMeta:__tostring()
return "character[" .. (self.id or 0) .. "]"
end
Expand All @@ -35,7 +35,7 @@ end
-- local char1 = lia.char.loaded[1]
-- local char2 = lia.char.loaded[2]
-- print(char1 == char2)
-- -- Output: false
-- Output: false
function characterMeta:__eq(other)
return self:getID() == other:getID()
end
Expand All @@ -46,7 +46,7 @@ end
-- @usage
-- local charID = character:getID()
-- print(charID)
-- -- Output: 1
-- Output: 1
function characterMeta:getID()
return self.id
end
Expand Down Expand Up @@ -164,7 +164,7 @@ if SERVER then
-- @string flags A string containing one or more flags to assign to the character.
-- @usage
-- character:setFlags("petr")
-- -- This sets the character's flags to 'p', 'e', 't', 'r'
-- This sets the character's flags to 'p', 'e', 't', 'r'
function characterMeta:setFlags(flags)
self:setData("f", flags)
end
Expand All @@ -174,7 +174,7 @@ if SERVER then
-- @string flags A string containing one or more flags to add.
-- @usage
-- character:giveFlags("pet")
-- -- Adds 'p', 'e', and 't' flags to the character
-- Adds 'p', 'e', and 't' flags to the character
function characterMeta:giveFlags(flags)
local addedFlags = ""
for i = 1, #flags do
Expand All @@ -193,9 +193,9 @@ if SERVER then
-- @realm server
-- @string flags A string containing one or more flags to remove.
-- @usage
-- -- For a character with "pet" flags
-- For a character with "pet" flags
-- character:takeFlags("p")
-- -- The character now only has 'e' and 't' flags
-- The character now only has 'e' and 't' flags
function characterMeta:takeFlags(flags)
local oldFlags = self:getFlags()
local newFlags = oldFlags
Expand Down
4 changes: 2 additions & 2 deletions lilia/gamemode/core/meta/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ end
-- @see lia.inventory.newType
-- @usage
-- inventory:register("grid")
-- -- This sets the inventory's type to 'grid'
-- This sets the inventory's type to 'grid'
function Inventory:register(typeID)
assert(isstring(typeID), "Expected argument #1 of " .. self.className .. ".register to be a string")
self.typeID = typeID
Expand Down Expand Up @@ -136,7 +136,7 @@ end
-- @treturn String A string representation of the inventory, including its class name and ID.
-- @usage
-- print(tostring(inventory))
-- -- Output: "Inventory[123]"
-- Output: "Inventory[123]"
function Inventory:__tostring()
return self.className .. "[" .. tostring(self.id) .. "]"
end
Expand Down
2 changes: 1 addition & 1 deletion lilia/gamemode/core/meta/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end
-- @treturn String String representation.
-- @usage
-- print(tostring(lia.item.instances[1]))
-- -- Output: "item[uniqueID][1]"
-- Output: "item[uniqueID][1]"
function ITEM:__tostring()
return "item[" .. self.uniqueID .. "][" .. self.id .. "]"
end
Expand Down
Loading

0 comments on commit b6f6f1c

Please sign in to comment.