Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
d8cbc575
Commit
d8cbc575
authored
Apr 15, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关键词与卡名一致则在搜索结果置顶
显示顺序按怪兽-魔法-陷阱排序
parent
8795dba1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
+30
-14
No files found.
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
View file @
d8cbc575
...
@@ -22,6 +22,7 @@ import ocgcore.DataManager;
...
@@ -22,6 +22,7 @@ import ocgcore.DataManager;
import
ocgcore.LimitManager
;
import
ocgcore.LimitManager
;
import
ocgcore.data.Card
;
import
ocgcore.data.Card
;
import
ocgcore.data.LimitList
;
import
ocgcore.data.LimitList
;
import
ocgcore.enums.CardType
;
import
ocgcore.enums.LimitType
;
import
ocgcore.enums.LimitType
;
public
class
CardLoader
implements
ICardLoader
{
public
class
CardLoader
implements
ICardLoader
{
...
@@ -124,27 +125,33 @@ public class CardLoader implements ICardLoader {
...
@@ -124,27 +125,33 @@ public class CardLoader implements ICardLoader {
Dialog
wait
=
DialogPlus
.
show
(
context
,
null
,
context
.
getString
(
R
.
string
.
searching
));
Dialog
wait
=
DialogPlus
.
show
(
context
,
null
,
context
.
getString
(
R
.
string
.
searching
));
VUiKit
.
defer
().
when
(()
->
{
VUiKit
.
defer
().
when
(()
->
{
List
<
Card
>
tmp
=
new
ArrayList
<
Card
>();
List
<
Card
>
tmp
=
new
ArrayList
<
Card
>();
List
<
Card
>
monster
=
new
ArrayList
<
Card
>();
List
<
Card
>
spell
=
new
ArrayList
<
Card
>();
List
<
Card
>
trap
=
new
ArrayList
<
Card
>();
SparseArray
<
Card
>
cards
=
mCardManager
.
getAllCards
();
SparseArray
<
Card
>
cards
=
mCardManager
.
getAllCards
();
int
count
=
cards
.
size
();
int
count
=
cards
.
size
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
Card
card
=
cards
.
valueAt
(
i
);
Card
card
=
cards
.
valueAt
(
i
);
if
(
searchInfo
==
null
||
searchInfo
.
check
(
card
))
{
if
(
searchInfo
==
null
||
searchInfo
.
check
(
card
))
{
if
(
searchInfo
!=
null
&&
card
.
Name
.
equals
(
searchInfo
.
word
))
{
cards
.
remove
(
i
);
tmp
.
add
(
card
);
tmp
.
add
(
card
);
}
}
else
if
(
card
.
isType
(
CardType
.
Monster
))
{
}
monster
.
add
(
card
);
if
(
searchInfo
!=
null
&&
searchInfo
.
getInCards
()
!=
null
)
{
}
else
if
(
card
.
isType
(
CardType
.
Spell
))
{
final
List
<
Integer
>
ids
=
searchInfo
.
getInCards
();
spell
.
add
(
card
);
Collections
.
sort
(
tmp
,
new
Comparator
<
Card
>()
{
}
else
if
(
card
.
isType
(
CardType
.
Trap
))
{
@Override
trap
.
add
(
card
);
public
int
compare
(
Card
o1
,
Card
o2
)
{
}
int
index1
=
ids
.
indexOf
(
Integer
.
valueOf
(
o1
.
Code
));
}
int
index2
=
ids
.
indexOf
(
Integer
.
valueOf
(
o2
.
Code
));
}
return
index1
-
index2
;
Collections
.
sort
(
tmp
,
ASCode
);
}
Collections
.
sort
(
monster
,
ASC
);
});
Collections
.
sort
(
spell
,
ASCode
);
}
else
{
Collections
.
sort
(
trap
,
ASCode
);
Collections
.
sort
(
tmp
,
ASC
);
tmp
.
addAll
(
monster
);
}
tmp
.
addAll
(
spell
);
tmp
.
addAll
(
trap
);
return
tmp
;
return
tmp
;
}).
fail
((
e
)
->
{
}).
fail
((
e
)
->
{
if
(
mCallBack
!=
null
)
{
if
(
mCallBack
!=
null
)
{
...
@@ -160,6 +167,15 @@ public class CardLoader implements ICardLoader {
...
@@ -160,6 +167,15 @@ public class CardLoader implements ICardLoader {
});
});
}
}
private
Comparator
<
Card
>
ASCode
=
new
Comparator
<
Card
>()
{
@Override
public
int
compare
(
Card
o1
,
Card
o2
)
{
int
index1
=
(
Integer
.
valueOf
(
o1
.
Code
).
intValue
());
int
index2
=
(
Integer
.
valueOf
(
o2
.
Code
).
intValue
());
return
index1
-
index2
;
}
};
private
Comparator
<
Card
>
ASC
=
new
Comparator
<
Card
>()
{
private
Comparator
<
Card
>
ASC
=
new
Comparator
<
Card
>()
{
@Override
@Override
public
int
compare
(
Card
o1
,
Card
o2
)
{
public
int
compare
(
Card
o1
,
Card
o2
)
{
...
...
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