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
d94847e8
Commit
d94847e8
authored
Sep 07, 2021
by
qq247321453
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增规则
parent
cecbd817
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
42 deletions
+68
-42
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
.../main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
+1
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
+1
-1
mobile/src/main/java/ocgcore/CardManager.java
mobile/src/main/java/ocgcore/CardManager.java
+5
-4
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+13
-9
mobile/src/main/java/ocgcore/data/CardData.java
mobile/src/main/java/ocgcore/data/CardData.java
+18
-16
mobile/src/main/java/ocgcore/enums/CardOt.java
mobile/src/main/java/ocgcore/enums/CardOt.java
+26
-6
No files found.
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
View file @
d94847e8
...
...
@@ -112,13 +112,13 @@ class CardSearchInfo {
}
}
if
(
ot
>
0
)
{
if
(
card
.
Ot
!=
ot
)
{
if
(
card
.
Ot
.
getId
()
!=
ot
)
{
return
false
;
}
}
if
(
pscale
!=
-
1
)
{
if
(!
card
.
isType
(
CardType
.
Pendulum
)
||
card
.
L
Scale
!=
pscale
&&
card
.
R
Scale
!=
pscale
)
{
if
(!
card
.
isType
(
CardType
.
Pendulum
)
||
card
.
L
eftScale
!=
pscale
&&
card
.
Right
Scale
!=
pscale
)
{
return
false
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
View file @
d94847e8
package
cn.garymb.ygomobile.ui.adapters
;
import
android.content.Context
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
...
...
@@ -122,7 +121,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
}
if
(
item
.
isType
(
CardType
.
Pendulum
))
{
holder
.
layout_p_scale
.
setVisibility
(
View
.
VISIBLE
);
holder
.
cardScale
.
setText
(
String
.
valueOf
(
item
.
LScale
));
holder
.
cardScale
.
setText
(
String
.
valueOf
(
item
.
L
eft
Scale
));
}
else
{
holder
.
layout_p_scale
.
setVisibility
(
View
.
GONE
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
d94847e8
...
...
@@ -278,7 +278,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
type
.
setText
(
CardUtils
.
getAllTypeString
(
cardInfo
,
mStringManager
).
replace
(
"/"
,
"|"
));
attrView
.
setText
(
mStringManager
.
getAttributeString
(
cardInfo
.
Attribute
));
otView
.
setText
(
mStringManager
.
getOtString
(
cardInfo
.
Ot
,
""
+
cardInfo
.
Ot
));
otView
.
setText
(
mStringManager
.
getOtString
(
cardInfo
.
Ot
.
getId
(),
cardInfo
.
Ot
.
name
()
));
long
[]
sets
=
cardInfo
.
getSetCode
();
setName
.
setText
(
""
);
int
index
=
0
;
...
...
@@ -316,7 +316,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
if
(
cardInfo
.
isType
(
CardType
.
Pendulum
))
{
layoutDetailPScale
.
setVisibility
(
View
.
VISIBLE
);
detailCardScale
.
setText
(
String
.
valueOf
(
cardInfo
.
LScale
));
detailCardScale
.
setText
(
String
.
valueOf
(
cardInfo
.
L
eft
Scale
));
}
else
{
layoutDetailPScale
.
setVisibility
(
View
.
GONE
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
View file @
d94847e8
...
...
@@ -123,7 +123,7 @@ public class CardSort implements Comparator<Card> {
if
(
rs
!=
0
)
{
return
rs
;
}
rs
=
comp
(
c1
.
Ot
,
c2
.
Ot
);
rs
=
comp
(
c1
.
Ot
.
getId
(),
c2
.
Ot
.
getId
()
);
if
(
rs
!=
0
)
{
return
rs
;
}
...
...
mobile/src/main/java/ocgcore/CardManager.java
View file @
d94847e8
...
...
@@ -28,6 +28,7 @@ import cn.garymb.ygomobile.App;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
ocgcore.data.Card
;
import
ocgcore.enums.CardOt
;
public
class
CardManager
{
...
...
@@ -191,14 +192,14 @@ public class CardManager {
do
{
Card
cardData
=
new
Card
();
cardData
.
Code
=
reader
.
getInt
(
0
);
cardData
.
Ot
=
reader
.
getInt
(
1
);
cardData
.
Ot
=
CardOt
.
of
(
reader
.
getInt
(
1
)
);
cardData
.
Alias
=
reader
.
getInt
(
2
);
cardData
.
Set
c
ode
=
reader
.
getLong
(
3
);
cardData
.
Set
C
ode
=
reader
.
getLong
(
3
);
cardData
.
Type
=
reader
.
getLong
(
4
);
int
levelInfo
=
reader
.
getInt
(
5
);
cardData
.
Level
=
levelInfo
&
0xff
;
cardData
.
LScale
=
(
levelInfo
>>
24
)
&
0xff
;
cardData
.
RScale
=
(
levelInfo
>>
16
)
&
0xff
;
cardData
.
L
eft
Scale
=
(
levelInfo
>>
24
)
&
0xff
;
cardData
.
R
ight
Scale
=
(
levelInfo
>>
16
)
&
0xff
;
cardData
.
Race
=
reader
.
getLong
(
6
);
cardData
.
Attribute
=
reader
.
getInt
(
7
);
cardData
.
Attack
=
reader
.
getInt
(
8
);
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
d94847e8
...
...
@@ -43,15 +43,15 @@ public class Card extends CardData implements Parcelable {
if
(
cardData
!=
null
)
{
this
.
Code
=
cardData
.
Code
;
this
.
Alias
=
cardData
.
Alias
;
this
.
Set
code
=
cardData
.
Setc
ode
;
this
.
Set
Code
=
cardData
.
SetC
ode
;
this
.
Type
=
cardData
.
Type
;
this
.
Level
=
cardData
.
Level
;
this
.
Attribute
=
cardData
.
Attribute
;
this
.
Race
=
cardData
.
Race
;
this
.
Attack
=
cardData
.
Attack
;
this
.
Defense
=
cardData
.
Defense
;
this
.
L
Scale
=
cardData
.
L
Scale
;
this
.
R
Scale
=
cardData
.
R
Scale
;
this
.
L
eftScale
=
cardData
.
Left
Scale
;
this
.
R
ightScale
=
cardData
.
Right
Scale
;
this
.
Category
=
cardData
.
Category
;
}
}
...
...
@@ -83,6 +83,10 @@ public class Card extends CardData implements Parcelable {
return
(
Level
&
0xff
);
}
public
int
getLinkNumber
(){
return
getStar
();
}
public
boolean
isType
(
CardType
type
)
{
return
((
Type
&
type
.
value
())
!=
0
);
}
...
...
@@ -102,17 +106,17 @@ public class Card extends CardData implements Parcelable {
public
long
[]
getSetCode
()
{
long
[]
setcodes
=
new
long
[
SETCODE_MAX
];
for
(
int
i
=
0
,
k
=
0
;
i
<
SETCODE_MAX
;
k
+=
0x10
,
i
++)
{
setcodes
[
i
]
=
(
Set
c
ode
>>
k
)
&
0xffff
;
setcodes
[
i
]
=
(
Set
C
ode
>>
k
)
&
0xffff
;
}
return
setcodes
;
}
public
void
setSetCode
(
long
[]
setcodes
)
{
int
i
=
0
;
this
.
Set
c
ode
=
0
;
this
.
Set
C
ode
=
0
;
if
(
setcodes
!=
null
)
{
for
(
long
sc
:
setcodes
)
{
this
.
Set
c
ode
+=
(
sc
<<
i
);
this
.
Set
C
ode
+=
(
sc
<<
i
);
i
+=
0x10
;
}
}
...
...
@@ -138,15 +142,15 @@ public class Card extends CardData implements Parcelable {
return
"Card{"
+
"Code="
+
Code
+
", Alias="
+
Alias
+
", Setcode="
+
Set
c
ode
+
", Setcode="
+
Set
C
ode
+
", Type="
+
Type
+
", Level="
+
Level
+
", Attribute="
+
Attribute
+
", Race="
+
Race
+
", Attack="
+
Attack
+
", Defense="
+
Defense
+
", LScale="
+
LScale
+
", RScale="
+
RScale
+
", LScale="
+
L
eft
Scale
+
", RScale="
+
R
ight
Scale
+
", Name='"
+
Name
+
'\''
+
", Desc='"
+
Desc
+
'\''
+
'}'
;
...
...
mobile/src/main/java/ocgcore/data/CardData.java
View file @
d94847e8
...
...
@@ -3,6 +3,8 @@ package ocgcore.data;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
ocgcore.enums.CardOt
;
public
class
CardData
implements
Parcelable
{
public
CardData
()
{
...
...
@@ -11,19 +13,18 @@ public class CardData implements Parcelable{
public
CardData
(
int
code
)
{
Code
=
code
;
}
public
int
Code
;
public
in
t
Ot
;
public
CardO
t
Ot
;
public
int
Alias
;
public
long
Set
c
ode
;
public
long
Set
C
ode
;
public
long
Type
;
public
int
Level
;
public
int
Attribute
;
public
long
Race
;
public
int
Attack
;
public
int
Defense
;
public
int
LScale
;
public
int
RScale
;
public
int
L
eft
Scale
;
public
int
R
ight
Scale
;
public
long
Category
;
@Override
...
...
@@ -32,15 +33,15 @@ public class CardData implements Parcelable{
"Code="
+
Code
+
", Ot="
+
Ot
+
", Alias="
+
Alias
+
", Setcode="
+
Set
c
ode
+
", Setcode="
+
Set
C
ode
+
", Type="
+
Type
+
", Level="
+
Level
+
", Attribute="
+
Attribute
+
", Race="
+
Race
+
", Attack="
+
Attack
+
", Defense="
+
Defense
+
", LScale="
+
LScale
+
", RScale="
+
RScale
+
", LScale="
+
L
eft
Scale
+
", RScale="
+
R
ight
Scale
+
", Category="
+
Category
+
'}'
;
}
...
...
@@ -53,33 +54,33 @@ public class CardData implements Parcelable{
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeInt
(
this
.
Code
);
dest
.
writeInt
(
this
.
Ot
);
dest
.
writeInt
(
this
.
Ot
.
getId
()
);
dest
.
writeInt
(
this
.
Alias
);
dest
.
writeLong
(
this
.
Set
c
ode
);
dest
.
writeLong
(
this
.
Set
C
ode
);
dest
.
writeLong
(
this
.
Type
);
dest
.
writeInt
(
this
.
Level
);
dest
.
writeInt
(
this
.
Attribute
);
dest
.
writeLong
(
this
.
Race
);
dest
.
writeInt
(
this
.
Attack
);
dest
.
writeInt
(
this
.
Defense
);
dest
.
writeInt
(
this
.
LScale
);
dest
.
writeInt
(
this
.
RScale
);
dest
.
writeInt
(
this
.
L
eft
Scale
);
dest
.
writeInt
(
this
.
R
ight
Scale
);
dest
.
writeLong
(
this
.
Category
);
}
protected
CardData
(
Parcel
in
)
{
this
.
Code
=
in
.
readInt
();
this
.
Ot
=
in
.
readInt
(
);
this
.
Ot
=
CardOt
.
of
(
in
.
readInt
()
);
this
.
Alias
=
in
.
readInt
();
this
.
Set
c
ode
=
in
.
readLong
();
this
.
Set
C
ode
=
in
.
readLong
();
this
.
Type
=
in
.
readLong
();
this
.
Level
=
in
.
readInt
();
this
.
Attribute
=
in
.
readInt
();
this
.
Race
=
in
.
readLong
();
this
.
Attack
=
in
.
readInt
();
this
.
Defense
=
in
.
readInt
();
this
.
LScale
=
in
.
readInt
();
this
.
RScale
=
in
.
readInt
();
this
.
L
eft
Scale
=
in
.
readInt
();
this
.
R
ight
Scale
=
in
.
readInt
();
this
.
Category
=
in
.
readLong
();
}
...
...
@@ -94,4 +95,5 @@ public class CardData implements Parcelable{
return
new
CardData
[
size
];
}
};
}
mobile/src/main/java/ocgcore/enums/CardOt.java
View file @
d94847e8
package
ocgcore.enums
;
public
enum
CardOt
{
All
,
OCG
,
TCG
,
OCG_TCG
,
CUSTOM
/*,
简中*/
ALL
(
0
),
OCG
(
1
),
TCG
(
2
),
NO_EXCLUSIVE
(
3
),
CUSTOM
(
4
),
SC_OCG
(
8
),
UNKNOWN
(
999
);
/*简中*/
private
final
int
value
;
private
CardOt
(
int
value
)
{
this
.
value
=
value
;
}
public
int
getId
(){
return
value
;
}
public
static
CardOt
of
(
int
value
){
for
(
CardOt
cardOt:
values
()){
if
(
cardOt
.
value
==
value
){
return
cardOt
;
}
}
return
UNKNOWN
;
}
}
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