---Check if the text of this card mentions the name of `code`.
---@return boolean
---@param code integer
function Card.IsTextMention (code) end
It is the basic version.
It can only check the card name which is NOT a setname.
The card name which is also a setname can be checked by the old Auxiliary.IsCodeListed.
Personally I don't like doing in this way, for the following reasons.
String searching has a complexity of O(n^2) which slows server down being a regular condition check.
This changes server deployment a lot, requiring to upload strings.conf as well. Btw is this commit tested on Mac / Linux? I doubt wstring works on those OSes. This is important because our server deploys on Linux.
This also consumes server memory a lot, requiring to load every strings from cdb and strings.conf to memory. It's 7 MB in size for the current cards.cdb file. We could have 500 duels at once in our most popular servers, so if loading all of them, it would consume around 3.5 GB more memory, which is not acceptable.
@mercury233 @purerosefallen ocgapi: new API
new function:
new Lua function
It is the basic version. It can only check the card name which is NOT a setname. The card name which is also a setname can be checked by the old
Auxiliary.IsCodeListed
.