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
6d621d16
Commit
6d621d16
authored
Nov 01, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加'<', '=', '>'的攻守搜索方法
parent
409d8abf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
8 deletions
+33
-8
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
.../main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
+25
-8
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+8
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
View file @
6d621d16
...
...
@@ -200,6 +200,27 @@ public class CardSearchInfo implements ICardFilter{
return
false
;
}
public
boolean
chkAtkDef
(
int
ct
,
String
search
)
{
switch
(
search
.
charAt
(
0
))
{
case
'>'
:
if
(
search
.
length
()
>
1
&&
search
.
charAt
(
1
)
==
'='
)
{
return
ct
>=
(
TextUtils
.
isDigitsOnly
(
search
.
substring
(
2
))
?
i
(
search
.
substring
(
2
))
:
-
2
);
}
else
{
return
ct
>
(
TextUtils
.
isDigitsOnly
(
search
.
substring
(
1
))
?
i
(
search
.
substring
(
1
))
:
-
2
);
}
case
'<'
:
if
(
search
.
length
()
>
1
&&
search
.
charAt
(
1
)
==
'='
)
{
return
ct
<=
(
TextUtils
.
isDigitsOnly
(
search
.
substring
(
2
))
?
i
(
search
.
substring
(
2
))
:
-
2
);
}
else
{
return
ct
<
(
TextUtils
.
isDigitsOnly
(
search
.
substring
(
1
))
?
i
(
search
.
substring
(
1
))
:
-
2
);
}
case
'='
:
return
ct
==
(
TextUtils
.
isDigitsOnly
(
search
.
substring
(
1
))
?
i
(
search
.
substring
(
1
))
:
-
2
);
default
:
return
ct
==
(
TextUtils
.
isDigitsOnly
(
search
)
?
i
(
search
)
:
-
2
);
}
}
@Override
public
boolean
isValid
(
Card
card
)
{
if
(
keyWord
!=
null
&&
!
keyWord
.
isValid
(
card
)){
...
...
@@ -221,10 +242,8 @@ public class CardSearchInfo implements ICardFilter{
if
(!(
i
(
atks
[
0
])
<=
card
.
Attack
&&
card
.
Attack
<=
i
(
atks
[
1
])))
{
return
false
;
}
}
else
{
if
(
card
.
Attack
!=
((
TextUtils
.
isDigitsOnly
(
atk
)
?
i
(
atk
)
:
-
2
)))
{
return
false
;
}
}
else
if
(!
chkAtkDef
(
card
.
Attack
,
atk
))
{
return
false
;
}
}
...
...
@@ -239,10 +258,8 @@ public class CardSearchInfo implements ICardFilter{
if
(!(
i
(
defs
[
0
])
<=
card
.
Defense
&&
card
.
Defense
<=
i
(
defs
[
1
])))
{
return
false
;
}
}
else
{
if
(
card
.
Defense
!=
((
TextUtils
.
isDigitsOnly
(
def
)
?
i
(
def
)
:
-
2
)))
{
return
false
;
}
}
else
if
(
card
.
isLink
()
||
!
chkAtkDef
(
card
.
Defense
,
def
))
{
return
false
;
}
}
}
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
6d621d16
...
...
@@ -83,6 +83,10 @@ public class Card extends CardData implements Parcelable {
return
(
isType
(
Type
,
CardType
.
Fusion
)
||
isType
(
Type
,
CardType
.
Synchro
)
||
isType
(
Type
,
CardType
.
Xyz
)
||
isType
(
Type
,
CardType
.
Link
));
}
public
static
boolean
isLink
(
long
Type
)
{
return
isType
(
Type
,
CardType
.
Link
);
}
public
Card
type
(
long
type
)
{
this
.
Type
=
type
;
return
this
;
...
...
@@ -120,6 +124,10 @@ public class Card extends CardData implements Parcelable {
return
isSpellTrap
(
Type
);
}
public
boolean
isLink
()
{
return
isType
(
Type
,
CardType
.
Link
);
}
public
boolean
isExtraCard
()
{
return
(
isType
(
CardType
.
Fusion
)
||
isType
(
CardType
.
Synchro
)
||
isType
(
CardType
.
Xyz
)
||
isType
(
Type
,
CardType
.
Link
));
}
...
...
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