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
0fb4878c
Commit
0fb4878c
authored
Sep 23, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deckinfo添加卡包pack类型
parent
861237ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
+4
-0
mobile/src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
+18
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemType.java
.../java/cn/garymb/ygomobile/ui/cards/deck/DeckItemType.java
+1
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
View file @
0fb4878c
...
@@ -520,6 +520,10 @@ public class Deck implements Parcelable {
...
@@ -520,6 +520,10 @@ public class Deck implements Parcelable {
return
allList
;
return
allList
;
}
}
public
void
addPack
(
Integer
id
)
{
mainlist
.
add
(
id
);
}
public
void
addMain
(
Integer
id
)
{
public
void
addMain
(
Integer
id
)
{
if
(
mainlist
.
size
()
>=
Constants
.
DECK_MAIN_MAX
)
{
if
(
mainlist
.
size
()
>=
Constants
.
DECK_MAIN_MAX
)
{
return
;
return
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
View file @
0fb4878c
...
@@ -52,11 +52,11 @@ public class DeckLoader {
...
@@ -52,11 +52,11 @@ public class DeckLoader {
Deck
deck
=
new
Deck
();
Deck
deck
=
new
Deck
();
SparseArray
<
Integer
>
mIds
=
new
SparseArray
<>();
SparseArray
<
Integer
>
mIds
=
new
SparseArray
<>();
InputStreamReader
in
=
null
;
InputStreamReader
in
=
null
;
DeckItemType
type
=
DeckItemType
.
Space
;
try
{
try
{
in
=
new
InputStreamReader
(
inputStream
,
"utf-8"
);
in
=
new
InputStreamReader
(
inputStream
,
"utf-8"
);
BufferedReader
reader
=
new
BufferedReader
(
in
);
BufferedReader
reader
=
new
BufferedReader
(
in
);
String
line
=
null
;
String
line
=
null
;
DeckItemType
type
=
DeckItemType
.
Space
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
while
((
line
=
reader
.
readLine
())
!=
null
)
{
if
(
line
.
startsWith
(
"!side"
))
{
if
(
line
.
startsWith
(
"!side"
))
{
type
=
DeckItemType
.
SideCard
;
type
=
DeckItemType
.
SideCard
;
...
@@ -67,6 +67,8 @@ public class DeckLoader {
...
@@ -67,6 +67,8 @@ public class DeckLoader {
type
=
DeckItemType
.
MainCard
;
type
=
DeckItemType
.
MainCard
;
}
else
if
(
line
.
startsWith
(
"#extra"
))
{
}
else
if
(
line
.
startsWith
(
"#extra"
))
{
type
=
DeckItemType
.
ExtraCard
;
type
=
DeckItemType
.
ExtraCard
;
}
else
{
type
=
DeckItemType
.
Pack
;
}
}
continue
;
continue
;
}
}
...
@@ -76,7 +78,7 @@ public class DeckLoader {
...
@@ -76,7 +78,7 @@ public class DeckLoader {
Log
.
w
(
"kk"
,
"read not number "
+
line
);
Log
.
w
(
"kk"
,
"read not number "
+
line
);
continue
;
continue
;
}
}
if
(
line
.
length
()
>
9
)
{
//密码如果
大于9位直接过滤
if
(
line
.
equals
(
"0"
)
||
line
.
length
()
>
9
)
{
//密码为0或者长度
大于9位直接过滤
continue
;
continue
;
}
}
Integer
id
=
Integer
.
parseInt
(
line
);
Integer
id
=
Integer
.
parseInt
(
line
);
...
@@ -107,6 +109,15 @@ public class DeckLoader {
...
@@ -107,6 +109,15 @@ public class DeckLoader {
mIds
.
put
(
id
,
i
+
1
);
mIds
.
put
(
id
,
i
+
1
);
deck
.
addSide
(
id
);
deck
.
addSide
(
id
);
}
}
}
else
if
(
type
==
DeckItemType
.
Pack
)
{
Integer
i
=
mIds
.
get
(
id
);
if
(
i
==
null
)
{
mIds
.
put
(
id
,
1
);
deck
.
addPack
(
id
);
}
else
if
(
i
<
Constants
.
CARD_MAX_COUNT
)
{
mIds
.
put
(
id
,
i
+
1
);
deck
.
addPack
(
id
);
}
}
}
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -125,7 +136,11 @@ public class DeckLoader {
...
@@ -125,7 +136,11 @@ public class DeckLoader {
tmp
.
put
(
id
,
cardLoader
.
readAllCardCodes
().
get
(
code
));
tmp
.
put
(
id
,
cardLoader
.
readAllCardCodes
().
get
(
code
));
isChanged
=
true
;
isChanged
=
true
;
}
}
deckInfo
.
addMainCards
(
tmp
.
get
(
id
));
if
(
type
==
DeckItemType
.
Pack
)
{
deckInfo
.
addMainCards
(
id
,
tmp
.
get
(
id
),
true
);
}
else
{
deckInfo
.
addMainCards
(
id
,
tmp
.
get
(
id
),
false
);
}
}
}
tmp
=
cardLoader
.
readCards
(
deck
.
getExtraList
(),
true
);
tmp
=
cardLoader
.
readCards
(
deck
.
getExtraList
(),
true
);
for
(
Integer
id
:
deck
.
getExtraList
())
{
for
(
Integer
id
:
deck
.
getExtraList
())
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemType.java
View file @
0fb4878c
...
@@ -8,4 +8,5 @@ public enum DeckItemType {
...
@@ -8,4 +8,5 @@ public enum DeckItemType {
SideLabel
,
SideLabel
,
SideCard
,
SideCard
,
Space
,
Space
,
Pack
}
}
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