Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
nanahira
ygopro
Commits
a0af40c2
Commit
a0af40c2
authored
May 27, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add DECK_MAX_SIZE, DECK_MIN_SIZE
parent
19908a9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
gframe/deck_con.cpp
gframe/deck_con.cpp
+4
-4
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+5
-5
gframe/deck_manager.h
gframe/deck_manager.h
+4
-0
No files found.
gframe/deck_con.cpp
View file @
a0af40c2
...
...
@@ -1249,7 +1249,7 @@ void DeckBuilder::GetHoveredCard() {
}
else
if
(
y
>=
164
&&
y
<=
435
)
{
int
lx
=
10
,
px
,
py
=
(
y
-
164
)
/
68
;
hovered_pos
=
1
;
if
(
deckManager
.
current_deck
.
main
.
size
()
>
40
)
if
(
deckManager
.
current_deck
.
main
.
size
()
>
DECK_MIN_SIZE
)
lx
=
(
deckManager
.
current_deck
.
main
.
size
()
-
41
)
/
4
+
11
;
if
(
x
>=
750
)
px
=
lx
-
1
;
...
...
@@ -1757,7 +1757,7 @@ bool DeckBuilder::push_main(code_pointer pointer, int seq) {
if
(
pointer
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
return
false
;
auto
&
container
=
deckManager
.
current_deck
.
main
;
int
maxc
=
mainGame
->
is_siding
?
64
:
60
;
int
maxc
=
mainGame
->
is_siding
?
64
:
DECK_MAX_SIZE
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
@@ -1772,7 +1772,7 @@ bool DeckBuilder::push_extra(code_pointer pointer, int seq) {
if
(
!
(
pointer
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)))
return
false
;
auto
&
container
=
deckManager
.
current_deck
.
extra
;
int
maxc
=
mainGame
->
is_siding
?
20
:
15
;
int
maxc
=
mainGame
->
is_siding
?
20
:
EXTRA_MAX_SIZE
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
@@ -1785,7 +1785,7 @@ bool DeckBuilder::push_extra(code_pointer pointer, int seq) {
}
bool
DeckBuilder
::
push_side
(
code_pointer
pointer
,
int
seq
)
{
auto
&
container
=
deckManager
.
current_deck
.
side
;
int
maxc
=
mainGame
->
is_siding
?
20
:
15
;
int
maxc
=
mainGame
->
is_siding
?
20
:
SIDE_MAX_SIZE
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
gframe/deck_manager.cpp
View file @
a0af40c2
...
...
@@ -86,11 +86,11 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if
(
!
list
)
return
0
;
int
dc
=
0
;
if
(
deck
.
main
.
size
()
<
40
||
deck
.
main
.
size
()
>
60
)
if
(
deck
.
main
.
size
()
<
DECK_MIN_SIZE
||
deck
.
main
.
size
()
>
DECK_MAX_SIZE
)
return
(
DECKERROR_MAINCOUNT
<<
28
)
+
deck
.
main
.
size
();
if
(
deck
.
extra
.
size
()
>
15
)
if
(
deck
.
extra
.
size
()
>
EXTRA_MAX_SIZE
)
return
(
DECKERROR_EXTRACOUNT
<<
28
)
+
deck
.
extra
.
size
();
if
(
deck
.
side
.
size
()
>
15
)
if
(
deck
.
side
.
size
()
>
SIDE_MAX_SIZE
)
return
(
DECKERROR_SIDECOUNT
<<
28
)
+
deck
.
side
.
size
();
const
int
rule_map
[
6
]
=
{
AVAIL_OCG
,
AVAIL_TCG
,
AVAIL_SC
,
AVAIL_CUSTOM
,
AVAIL_OCGTCG
,
0
};
int
avail
=
rule_map
[
rule
];
...
...
@@ -158,10 +158,10 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
continue
;
}
else
if
(
cd
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
{
if
(
deck
.
extra
.
size
()
>=
15
)
if
(
deck
.
extra
.
size
()
>=
EXTRA_MAX_SIZE
)
continue
;
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
}
else
if
(
deck
.
main
.
size
()
<
60
)
{
}
else
if
(
deck
.
main
.
size
()
<
DECK_MAX_SIZE
)
{
deck
.
main
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
}
}
...
...
gframe/deck_manager.h
View file @
a0af40c2
...
...
@@ -8,6 +8,10 @@
#include <sstream>
namespace
ygo
{
constexpr
int
DECK_MAX_SIZE
=
60
;
constexpr
int
DECK_MIN_SIZE
=
40
;
constexpr
int
EXTRA_MAX_SIZE
=
15
;
constexpr
int
SIDE_MAX_SIZE
=
15
;
struct
LFList
{
unsigned
int
hash
{};
...
...
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