Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-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
苍蓝
rd-ygopro
Commits
d71ff122
Commit
d71ff122
authored
Dec 16, 2023
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ClientCard: add destructor
parent
75bbf24b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
gframe/client_card.cpp
gframe/client_card.cpp
+25
-1
gframe/client_card.h
gframe/client_card.h
+2
-1
No files found.
gframe/client_card.cpp
View file @
d71ff122
...
@@ -5,7 +5,28 @@
...
@@ -5,7 +5,28 @@
namespace
ygo
{
namespace
ygo
{
ClientCard
::
ClientCard
()
{}
ClientCard
::~
ClientCard
()
{
ClearTarget
();
if
(
equipTarget
)
equipTarget
->
equipped
.
erase
(
this
);
for
(
auto
card
:
equipped
)
{
card
->
equipTarget
=
nullptr
;
}
equipped
.
clear
();
if
(
overlayTarget
)
{
for
(
auto
it
=
overlayTarget
->
overlayed
.
begin
();
it
!=
overlayTarget
->
overlayed
.
end
();
)
{
if
(
*
it
==
this
)
{
it
=
overlayTarget
->
overlayed
.
erase
(
it
);
}
else
++
it
;
}
}
for
(
auto
card
:
overlayed
)
{
card
->
overlayTarget
=
nullptr
;
}
overlayed
.
clear
();
}
void
ClientCard
::
SetCode
(
int
code
)
{
void
ClientCard
::
SetCode
(
int
code
)
{
if
((
location
==
LOCATION_HAND
)
&&
(
this
->
code
!=
(
unsigned
int
)
code
))
{
if
((
location
==
LOCATION_HAND
)
&&
(
this
->
code
!=
(
unsigned
int
)
code
))
{
this
->
code
=
code
;
this
->
code
=
code
;
...
@@ -184,6 +205,9 @@ void ClientCard::ClearData() {
...
@@ -184,6 +205,9 @@ void ClientCard::ClearData() {
rscstring
[
0
]
=
0
;
rscstring
[
0
]
=
0
;
lscstring
[
0
]
=
0
;
lscstring
[
0
]
=
0
;
counters
.
clear
();
counters
.
clear
();
for
(
auto
card
:
equipped
)
{
card
->
equipTarget
=
nullptr
;
}
equipped
.
clear
();
equipped
.
clear
();
}
}
bool
ClientCard
::
client_card_sort
(
ClientCard
*
c1
,
ClientCard
*
c2
)
{
bool
ClientCard
::
client_card_sort
(
ClientCard
*
c1
,
ClientCard
*
c2
)
{
...
...
gframe/client_card.h
View file @
d71ff122
...
@@ -111,7 +111,8 @@ public:
...
@@ -111,7 +111,8 @@ public:
wchar_t
lscstring
[
16
]{
0
};
wchar_t
lscstring
[
16
]{
0
};
wchar_t
rscstring
[
16
]{
0
};
wchar_t
rscstring
[
16
]{
0
};
ClientCard
();
ClientCard
()
=
default
;
~
ClientCard
();
void
SetCode
(
int
code
);
void
SetCode
(
int
code
);
void
UpdateInfo
(
unsigned
char
*
buf
);
void
UpdateInfo
(
unsigned
char
*
buf
);
void
ClearTarget
();
void
ClearTarget
();
...
...
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