Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts-888
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-scripts-888
Commits
ba5b7612
Commit
ba5b7612
authored
Nov 01, 2023
by
Chen Bill
Committed by
GitHub
Nov 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group functions definition (#2158)
* Group functions definition * update def
parent
a7570a36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
utility.lua
utility.lua
+34
-0
No files found.
utility.lua
View file @
ba5b7612
...
...
@@ -968,6 +968,13 @@ function Auxiliary.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
sg
:
RemoveCard
(
c
)
return
res
end
---
---@param g Group
---@param f function
---@param min? integer
---@param max? integer
---@param ...? unknown
---@return boolean
function
Group
.
CheckSubGroup
(
g
,
f
,
min
,
max
,
...
)
min
=
min
or
1
max
=
max
or
#
g
...
...
@@ -984,6 +991,15 @@ function Group.CheckSubGroup(g,f,min,max,...)
end
return
false
end
---
---@param g Group
---@param tp integer
---@param f function
---@param cancelable boolean
---@param min? integer
---@param max? integer
---@param ...? unknown
---@return Group|nil
function
Group
.
SelectSubGroup
(
g
,
tp
,
f
,
cancelable
,
min
,
max
,
...
)
Auxiliary
.
SubGroupCaptured
=
Group
.
CreateGroup
()
min
=
min
or
1
...
...
@@ -1032,6 +1048,10 @@ function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...)
return
nil
end
end
---Create a table of filter functions
---@param f function
---@param list table
---@return table
function
Auxiliary
.
CreateChecks
(
f
,
list
)
local
checks
=
{}
for
i
=
1
,
#
list
do
...
...
@@ -1057,6 +1077,12 @@ function Auxiliary.CheckGroupRecursiveEach(c,sg,g,f,checks,ext_params)
sg
:
RemoveCard
(
c
)
return
res
end
---
---@param g Group
---@param checks table
---@param f? function
---@param ...? unknown
---@return boolean
function
Group
.
CheckSubGroupEach
(
g
,
checks
,
f
,
...
)
if
f
==
nil
then
f
=
Auxiliary
.
TRUE
end
if
#
g
<#
checks
then
return
false
end
...
...
@@ -1064,6 +1090,14 @@ function Group.CheckSubGroupEach(g,checks,f,...)
local
sg
=
Group
.
CreateGroup
()
return
g
:
IsExists
(
Auxiliary
.
CheckGroupRecursiveEach
,
1
,
sg
,
sg
,
g
,
f
,
checks
,
ext_params
)
end
---
---@param g Group
---@param tp integer
---@param checks table
---@param cancelable? boolean
---@param f? function
---@param ...? unknown
---@return Group|nil
function
Group
.
SelectSubGroupEach
(
g
,
tp
,
checks
,
cancelable
,
f
,
...
)
if
cancelable
==
nil
then
cancelable
=
false
end
if
f
==
nil
then
f
=
Auxiliary
.
TRUE
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment