Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
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
nanahira
ygopro2
Commits
50ea2be5
Commit
50ea2be5
authored
Sep 30, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expansions replace
parent
a019cfc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+1
-1
Assets/YGOSharp/CardsManager.cs
Assets/YGOSharp/CardsManager.cs
+16
-7
No files found.
Assets/SibylSystem/Program.cs
View file @
50ea2be5
...
...
@@ -409,7 +409,7 @@ public class Program : MonoBehaviour
{
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".cdb"
)
{
YGOSharp
.
CardsManager
.
initialize
(
"expansions/"
+
fileInfos
[
i
].
Name
);
YGOSharp
.
CardsManager
.
initialize
(
"expansions/"
+
fileInfos
[
i
].
Name
,
false
,
true
);
}
}
}
...
...
Assets/YGOSharp/CardsManager.cs
View file @
50ea2be5
...
...
@@ -16,7 +16,7 @@ namespace YGOSharp
public
static
string
nullString
=
""
;
internal
static
bool
initialize
(
string
databaseFullPath
,
bool
test
=
false
)
internal
static
bool
initialize
(
string
databaseFullPath
,
bool
test
=
false
,
bool
replace
=
false
)
{
if
(!
test
)
{
nullName
=
InterString
.
Get
(
"未知卡片"
);
...
...
@@ -41,7 +41,7 @@ namespace YGOSharp
{
while
(
reader
.
Read
())
{
LoadCard
(
reader
,
test
);
LoadCard
(
reader
,
test
,
replace
);
}
}
}
...
...
@@ -88,12 +88,21 @@ namespace YGOSharp
return
returnValue
;
}
private
static
void
LoadCard
(
IDataRecord
reader
,
bool
test
=
false
)
private
static
void
LoadCard
(
IDataRecord
reader
,
bool
test
=
false
,
bool
replace
=
false
)
{
Card
card
=
new
Card
(
reader
);
if
(!
_cards
.
ContainsKey
(
card
.
Id
)
&&
!
test
)
if
(
test
)
{
return
;
}
if
(!
_cards
.
ContainsKey
(
card
.
Id
))
{
_cards
.
Add
(
card
.
Id
,
card
);
}
else
if
(
replace
)
{
_cards
.
Remove
(
card
.
Id
);
_cards
.
Add
(
card
.
Id
,
card
);
}
}
...
...
@@ -581,9 +590,9 @@ namespace YGOSharp
c
.
packFullName
=
reader
.
GetString
(
2
);
string
[]
mats
=
temp
.
Split
(
"-"
);
if
(
mats
.
Length
>
1
)
c
.
packShortNam
=
mats
[
0
];
else
c
.
packShortNam
=
c
.
packFullName
.
Length
>
10
?
c
.
packFullName
.
Substring
(
0
,
10
)
+
"..."
:
c
.
packFullName
;
c
.
packShortNam
=
mats
[
0
];
else
c
.
packShortNam
=
c
.
packFullName
.
Length
>
10
?
c
.
packFullName
.
Substring
(
0
,
10
)
+
"..."
:
c
.
packFullName
;
c
.
reality
=
reader
.
GetString
(
3
);
temp
=
reader
.
GetString
(
4
);
mats
=
temp
.
Split
(
"/"
);
...
...
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