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
902453b5
Commit
902453b5
authored
Mar 08, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix字段查询结果
parent
4077c7c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
40 deletions
+35
-40
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+35
-40
No files found.
mobile/src/main/java/ocgcore/data/Card.java
View file @
902453b5
...
...
@@ -8,6 +8,17 @@ import ocgcore.enums.CardType;
public
class
Card
extends
CardData
implements
Parcelable
{
public
static
final
int
SETCODE_MAX
=
4
;
public
static
final
Creator
<
Card
>
CREATOR
=
new
Creator
<
Card
>()
{
@Override
public
Card
createFromParcel
(
Parcel
source
)
{
return
new
Card
(
source
);
}
@Override
public
Card
[]
newArray
(
int
size
)
{
return
new
Card
[
size
];
}
};
public
String
Name
;
public
String
Desc
;
...
...
@@ -26,11 +37,6 @@ public class Card extends CardData implements Parcelable {
super
(
code
);
}
public
Card
type
(
long
type
)
{
this
.
Type
=
type
;
return
this
;
}
public
Card
(
CardData
cardData
)
{
super
();
if
(
cardData
!=
null
)
{
...
...
@@ -49,22 +55,16 @@ public class Card extends CardData implements Parcelable {
}
}
public
int
getStar
()
{
return
(
Level
&
0xff
);
protected
Card
(
Parcel
in
)
{
super
(
in
);
this
.
Name
=
in
.
readString
();
this
.
Desc
=
in
.
readString
();
}
public
static
boolean
isType
(
long
Type
,
CardType
type
)
{
return
((
Type
&
type
.
value
())
!=
0
);
}
public
boolean
isType
(
CardType
type
)
{
return
((
Type
&
type
.
value
())
!=
0
);
}
public
boolean
onlyType
(
CardType
type
)
{
return
(
Type
==
type
.
value
());
}
public
static
boolean
isSpellTrap
(
long
Type
)
{
return
(
isType
(
Type
,
CardType
.
Spell
)
||
isType
(
Type
,
CardType
.
Trap
));
}
...
...
@@ -73,6 +73,23 @@ 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
Card
type
(
long
type
)
{
this
.
Type
=
type
;
return
this
;
}
public
int
getStar
()
{
return
(
Level
&
0xff
);
}
public
boolean
isType
(
CardType
type
)
{
return
((
Type
&
type
.
value
())
!=
0
);
}
public
boolean
onlyType
(
CardType
type
)
{
return
(
Type
==
type
.
value
());
}
public
boolean
isSpellTrap
()
{
return
isSpellTrap
(
Type
);
}
...
...
@@ -101,15 +118,12 @@ public class Card extends CardData implements Parcelable {
}
public
boolean
isSetCode
(
long
_setcode
)
{
int
settype
=
(
int
)
_setcode
&
0xfff
;
int
setsubtype
=
(
int
)
_setcode
&
0xf000
;
long
[]
setcodes
=
getSetCode
();
for
(
long
setcode
:
setcodes
)
{
String
setcode16
=
Long
.
toHexString
(
setcode
);
if
(
setcode16
.
length
()==
4
){
if
(
setcode16
.
endsWith
(
Long
.
toHexString
(
_setcode
)))
if
(((
int
)
setcode
&
0xfff
)
==
settype
&&
((
int
)
setcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
true
;
}
else
if
(
setcode
==
_setcode
)
{
return
true
;
}
}
return
false
;
}
...
...
@@ -133,7 +147,6 @@ public class Card extends CardData implements Parcelable {
'}'
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
@@ -145,22 +158,4 @@ public class Card extends CardData implements Parcelable {
dest
.
writeString
(
this
.
Name
);
dest
.
writeString
(
this
.
Desc
);
}
protected
Card
(
Parcel
in
)
{
super
(
in
);
this
.
Name
=
in
.
readString
();
this
.
Desc
=
in
.
readString
();
}
public
static
final
Creator
<
Card
>
CREATOR
=
new
Creator
<
Card
>()
{
@Override
public
Card
createFromParcel
(
Parcel
source
)
{
return
new
Card
(
source
);
}
@Override
public
Card
[]
newArray
(
int
size
)
{
return
new
Card
[
size
];
}
};
}
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