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
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-core
Commits
8439bbdc
Commit
8439bbdc
authored
May 17, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix card::is_extra_link_state
parent
ead52a92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
card.cpp
card.cpp
+24
-3
card.h
card.h
+1
-0
No files found.
card.cpp
View file @
8439bbdc
...
@@ -1404,21 +1404,42 @@ int32 card::check_extra_link(card_set* cset, card_set* excset, card_set* linked_
...
@@ -1404,21 +1404,42 @@ int32 card::check_extra_link(card_set* cset, card_set* excset, card_set* linked_
card* pcard = *cit;
card* pcard = *cit;
if(cset->find(pcard) != cset->end())
if(cset->find(pcard) != cset->end())
continue;
continue;
if(excset->find(pcard) != excset->end())
if(excset->find(pcard) != excset->end()) {
if(cset->find(this) != cset->end())
card_set omitted;
if(check_extra_link_finish(cset, &omitted))
return TRUE;
return TRUE;
}
card_set linked_group2;
card_set linked_group2;
pcard->get_mutual_linked_cards(&linked_group2);
pcard->get_mutual_linked_cards(&linked_group2);
if(!linked_group2.size())
if(!linked_group2.size())
continue;
continue;
cset->insert(pcard);
cset->insert(pcard);
int32 result = check_extra_link(cset, excset, &linked_group2);
int32 result = check_extra_link(cset, excset, &linked_group2);
cset->erase(pcard);
cset->erase(pcard);
if(result)
if(result)
return TRUE;
return TRUE;
}
}
return FALSE;
return FALSE;
}
}
int32 card::check_extra_link_finish(card_set* cset, card_set* omitted) {
if(cset->find(this) != cset->end())
return TRUE;
for(auto cit = cset->begin(); cit != cset->end(); ++cit) {
card* pcard = *cit;
if(omitted->find(pcard) != omitted->end())
continue;
card_set linked_group3;
pcard->get_mutual_linked_cards(&linked_group3);
if(!linked_group3.size())
continue;
omitted->insert(pcard);
int32 result = check_extra_link_finish(&linked_group3, omitted);
omitted->erase(pcard);
if(result)
return TRUE;
}
return FALSE;
}
int32 card::is_position(int32 pos) {
int32 card::is_position(int32 pos) {
return current.position & pos;
return current.position & pos;
}
}
...
...
card.h
View file @
8439bbdc
...
@@ -229,6 +229,7 @@ public:
...
@@ -229,6 +229,7 @@ public:
int32
is_link_state
();
int32
is_link_state
();
int32
is_extra_link_state
();
int32
is_extra_link_state
();
int32
check_extra_link
(
card_set
*
cset
,
card_set
*
excset
,
card_set
*
linked_group1
);
int32
check_extra_link
(
card_set
*
cset
,
card_set
*
excset
,
card_set
*
linked_group1
);
int32
check_extra_link_finish
(
card_set
*
cset
,
card_set
*
omitted
);
int32
is_position
(
int32
pos
);
int32
is_position
(
int32
pos
);
void
set_status
(
uint32
status
,
int32
enabled
);
void
set_status
(
uint32
status
,
int32
enabled
);
int32
get_status
(
uint32
status
);
int32
get_status
(
uint32
status
);
...
...
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