Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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-core
Commits
55679708
Commit
55679708
authored
Jan 18, 2024
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use array
parent
dde64688
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
card_data.h
card_data.h
+13
-5
No files found.
card_data.h
View file @
55679708
...
...
@@ -5,11 +5,12 @@
#include <vector>
constexpr
int
CARD_ARTWORK_VERSIONS_OFFSET
=
10
;
constexpr
int
SIZE_SETCODE
=
16
;
struct
card_data
{
uint32
code
{};
uint32
alias
{};
std
::
vector
<
uint16_t
>
setcode
;
uint16_t
setcode
[
SIZE_SETCODE
]{}
;
uint32
type
{};
uint32
level
{};
uint32
attribute
{};
...
...
@@ -23,7 +24,8 @@ struct card_data {
void
clear
()
{
code
=
0
;
alias
=
0
;
setcode
.
clear
();
for
(
auto
&
x
:
setcode
)
x
=
0
;
type
=
0
;
level
=
0
;
attribute
=
0
;
...
...
@@ -41,6 +43,8 @@ struct card_data {
for
(
auto
&
x
:
setcode
)
{
if
((
x
&
0x0fff
)
==
settype
&&
(
x
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
true
;
if
(
!
x
)
return
false
;
}
return
false
;
}
...
...
@@ -50,12 +54,16 @@ struct card_data {
}
void
set_setcode
(
uint64
value
)
{
setcode
.
clear
()
;
int
ctr
=
0
;
while
(
value
)
{
if
(
value
&
0xffff
)
setcode
.
push_back
(
value
&
0xffff
);
if
(
value
&
0xffff
)
{
setcode
[
ctr
]
=
value
&
0xffff
;
++
ctr
;
}
value
>>=
16
;
}
for
(
int
i
=
ctr
;
i
<
SIZE_SETCODE
;
++
i
)
setcode
[
i
]
=
0
;
}
};
...
...
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