Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
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
0
Merge Requests
0
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
Dark_Zane
MDPro3
Commits
2c21cc43
Commit
2c21cc43
authored
Apr 06, 2024
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix performance issues in selectSum
parent
e3992f78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
Assets/Scripts/MDPro3/Servants/OcgCore.cs
Assets/Scripts/MDPro3/Servants/OcgCore.cs
+19
-13
No files found.
Assets/Scripts/MDPro3/Servants/OcgCore.cs
View file @
2c21cc43
...
...
@@ -4713,28 +4713,34 @@ namespace MDPro3
return
new
int
[]
{
sum1
,
sum2
};
}
public
static
bool
CheckSelectable
(
List
<
GameCard
>
cards
,
GameCard
card
,
List
<
GameCard
>
selectedCards
,
int
max
)
public
static
bool
CheckSelectable
(
List
<
GameCard
>
cards
,
GameCard
card
,
List
<
GameCard
>
selectedCards
,
int
max
,
List
<
GameCard
>
unselectables
=
null
)
{
if
(
selectedCards
.
Count
>=
max
)
if
(
selectedCards
.
Count
>=
max
)
return
false
;
bool
returnValue
=
false
;
var
sum
=
GetSelectLevelSum
(
selectedCards
);
if
(
unselectables
==
null
)
unselectables
=
new
List
<
GameCard
>();
foreach
(
var
c
in
cards
)
if
(!
selectedCards
.
Contains
(
c
))
if
(!
unselectables
.
Contains
(
c
))
if
(
c
!=
card
)
if
(
sum
[
0
]
+
c
.
levelForSelect_1
>
Program
.
I
().
ocgcore
.
ES_level
||
sum
[
1
]
+
c
.
levelForSelect_2
>
Program
.
I
().
ocgcore
.
ES_level
)
unselectables
.
Add
(
c
);
if
(
sum
[
0
]
+
card
.
levelForSelect_1
==
Program
.
I
().
ocgcore
.
ES_level
||
sum
[
1
]
+
card
.
levelForSelect_2
==
Program
.
I
().
ocgcore
.
ES_level
)
return
true
;
else
{
var
newSelectedCards
=
new
List
<
GameCard
>();
if
(
selectedCards
!=
null
)
foreach
(
var
c
in
selectedCards
)
newSelectedCards
.
Add
(
c
);
newSelectedCards
.
Add
(
card
);
var
newSelectedCards
=
new
List
<
GameCard
>(
selectedCards
)
{
card
};
foreach
(
var
c
in
cards
)
if
(!
newSelectedCards
.
Contains
(
c
))
{
returnValue
=
CheckSelectable
(
cards
,
c
,
newSelectedCards
,
max
);
if
(
returnValue
)
return
true
;
}
if
(!
unselectables
.
Contains
(
c
))
if
(!
newSelectedCards
.
Contains
(
c
))
{
returnValue
=
CheckSelectable
(
cards
,
c
,
newSelectedCards
,
max
,
unselectables
);
if
(
returnValue
)
return
true
;
}
}
return
returnValue
;
}
...
...
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