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
baichixing
ygopro
Commits
eb60a60b
Commit
eb60a60b
authored
Aug 29, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve SortList()
parent
6e54a79c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
21 deletions
+18
-21
gframe/client_card.cpp
gframe/client_card.cpp
+3
-5
gframe/client_card.h
gframe/client_card.h
+1
-1
gframe/deck_con.cpp
gframe/deck_con.cpp
+12
-13
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/client_card.cpp
View file @
eb60a60b
...
...
@@ -263,11 +263,9 @@ bool ClientCard::deck_sort_def(code_pointer p1, code_pointer p2) {
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_name
(
code_pointer
p1
,
code_pointer
p2
)
{
CardString
cstr1
;
CardString
cstr2
;
dataManager
.
GetString
(
p1
->
second
.
code
,
&
cstr1
);
dataManager
.
GetString
(
p2
->
second
.
code
,
&
cstr2
);
int
res
=
wcscmp
(
cstr1
.
name
,
cstr2
.
name
);
const
wchar_t
*
name1
=
dataManager
.
GetName
(
p1
->
first
);
const
wchar_t
*
name2
=
dataManager
.
GetName
(
p2
->
first
);
int
res
=
wcscmp
(
name1
,
name2
);
if
(
res
!=
0
)
return
res
<
0
;
return
p1
->
first
<
p2
->
first
;
...
...
gframe/client_card.h
View file @
eb60a60b
...
...
@@ -41,7 +41,7 @@ struct CardString {
wchar_t
*
text
;
wchar_t
*
desc
[
16
];
};
typedef
std
::
unordered_map
<
unsigned
int
,
CardDataC
>::
iterator
code_pointer
;
typedef
std
::
unordered_map
<
unsigned
int
,
CardDataC
>::
const_
iterator
code_pointer
;
class
ClientCard
{
public:
...
...
gframe/deck_con.cpp
View file @
eb60a60b
...
...
@@ -896,29 +896,28 @@ void DeckBuilder::ClearFilter() {
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
}
void
DeckBuilder
::
SortList
()
{
auto
left
=
results
.
begin
();
const
wchar_t
*
pstr
=
mainGame
->
ebCardName
->
getText
();
for
(
auto
it
=
results
.
begin
();
it
!=
results
.
end
();
++
it
)
{
if
(
wcscmp
(
pstr
,
dataManager
.
GetName
((
*
it
)
->
first
))
==
0
)
{
std
::
iter_swap
(
left
,
it
);
++
left
;
}
}
switch
(
mainGame
->
cbSortType
->
getSelected
())
{
case
0
:
std
::
sort
(
results
.
begin
()
,
results
.
end
(),
ClientCard
::
deck_sort_lv
);
std
::
sort
(
left
,
results
.
end
(),
ClientCard
::
deck_sort_lv
);
break
;
case
1
:
std
::
sort
(
results
.
begin
()
,
results
.
end
(),
ClientCard
::
deck_sort_atk
);
std
::
sort
(
left
,
results
.
end
(),
ClientCard
::
deck_sort_atk
);
break
;
case
2
:
std
::
sort
(
results
.
begin
()
,
results
.
end
(),
ClientCard
::
deck_sort_def
);
std
::
sort
(
left
,
results
.
end
(),
ClientCard
::
deck_sort_def
);
break
;
case
3
:
std
::
sort
(
results
.
begin
()
,
results
.
end
(),
ClientCard
::
deck_sort_name
);
std
::
sort
(
left
,
results
.
end
(),
ClientCard
::
deck_sort_name
);
break
;
}
const
wchar_t
*
pstr
=
mainGame
->
ebCardName
->
getText
();
for
(
size_t
i
=
0
,
pos
=
0
;
i
<
results
.
size
();
++
i
){
code_pointer
ptr
=
results
[
i
];
if
(
wcscmp
(
pstr
,
dataManager
.
GetName
(
ptr
->
first
))
==
0
)
{
results
.
insert
(
results
.
begin
()
+
pos
,
ptr
);
results
.
erase
(
results
.
begin
()
+
i
+
1
);
pos
++
;
}
}
}
}
ocgcore
@
9e7c8ca8
Subproject commit
0c58f35e90a3baa10af009776235a53e11eae620
Subproject commit
9e7c8ca88d6ad773f299d19bc1f01f1af496a6ab
script
@
d10310ac
Subproject commit
4de8d4093e5767d90696c8abdd2f1d75215d6adb
Subproject commit
d10310ac812e85972884eaaf83f870e23c871f1c
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