Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
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
nanahira
DataEditorX
Commits
33564988
Commit
33564988
authored
Dec 08, 2016
by
keyongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持tcgeditor的存档解析
parent
874843a7
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9908 additions
and
0 deletions
+9908
-0
DataEditorX/Common/MySortList.cs
DataEditorX/Common/MySortList.cs
+40
-0
DataEditorX/Core/TCGEditor/CardSet.cs
DataEditorX/Core/TCGEditor/CardSet.cs
+66
-0
DataEditorX/DLL/Newtonsoft.Json.dll
DataEditorX/DLL/Newtonsoft.Json.dll
+0
-0
DataEditorX/DLL/Newtonsoft.Json.xml
DataEditorX/DLL/Newtonsoft.Json.xml
+9793
-0
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+8
-0
DataEditorX/Program.cs
DataEditorX/Program.cs
+1
-0
No files found.
DataEditorX/Common/MySortList.cs
0 → 100644
View file @
33564988
using
System
;
using
System.Collections.Generic
;
namespace
DataEditorX
{
class
MyComparer
<
K
>
:
IComparer
<
K
>
{
public
int
Compare
(
K
x
,
K
y
)
{
return
1
;
//永远不等,允许重复
}
}
public
class
MySortList
<
K
,
V
>
:
SortedList
<
K
,
V
>
{
public
MySortList
():
base
(
new
MyComparer
<
K
>())
{
}
public
new
void
Add
(
K
key
,
V
value
)
{
//falg用于跳出函数
int
flag
=
0
;
//检查是否具备这个key,并且检查value是否重复
foreach
(
KeyValuePair
<
K
,
V
>
item
in
this
)
{
if
(
item
.
Key
.
ToString
()
==
key
.
ToString
()
&&
item
.
Value
.
ToString
()
==
value
.
ToString
())
{
flag
=
1
;
}
}
if
(
flag
==
1
)
return
;
//跳出函数
//否则就加入
base
.
Add
(
key
,
value
);
}
}
}
DataEditorX/Core/TCGEditor/CardSet.cs
0 → 100644
View file @
33564988
using
System
;
using
System.IO
;
using
Newtonsoft.Json
;
namespace
DataEditorX
{
public
class
CardSet
{
public
int
game
;
public
int
version
;
public
MySortList
<
string
,
CardInfo
>
cards
;
}
public
class
CardInfo
{
public
string
title
;
public
string
artwork
;
public
int
[]
artwork_crop
;
/// <summary>
/// ?
/// </summary>
public
int
background
;
/// <summary>
/// ?
/// </summary>
public
int
rarity
;
public
int
attribute
;
public
int
level
;
public
int
icon
;
public
string
description
;
public
string
pendulum_description
;
public
int
[]
pendulum_scales
;
public
string
[]
subtypes
;
public
string
atk
;
public
string
def
;
public
string
edition
;
public
string
@set
;
public
string
card_number
;
public
string
limitation
;
/// <summary>
/// 0,1,1
/// </summary>
public
int
sticker
;
public
string
copyright
;
public
override
string
ToString
()
{
return
string
.
Format
(
"[CardInfo Title={0}, Artwork={1}, Artwork_crop={2}, Background={3}, Rarity={4}, Attribute={5}, Level={6}, Icon={7}, Description={8}, Pendulum_description={9}, Pendulum_scales={10}, Subtypes={11}, Atk={12}, Def={13}, Edition={14}, Set={15}, Card_number={16}, Limitation={17}, Sticker={18}, Copyright={19}]"
,
title
,
artwork
,
artwork_crop
,
background
,
rarity
,
attribute
,
level
,
icon
,
description
,
pendulum_description
,
pendulum_scales
,
subtypes
,
atk
,
def
,
edition
,
set
,
card_number
,
limitation
,
sticker
,
copyright
);
}
}
public
class
CardJson
{
public
static
void
test
(){
string
json
=
File
.
ReadAllText
(
@"F:\TCGEditor_v1.2\t.tcgb"
);
CardSet
cardset
=
JsonConvert
.
DeserializeObject
<
CardSet
>(
json
);
if
(
cardset
.
cards
!=
null
){
int
index
=
0
;
foreach
(
string
key
in
cardset
.
cards
.
Keys
){
Console
.
WriteLine
(
key
);
CardInfo
card
=
cardset
.
cards
.
Values
[
index
];
Console
.
WriteLine
(
card
);
index
++;
}
}
Console
.
ReadKey
();
}
}
}
\ No newline at end of file
DataEditorX/DLL/Newtonsoft.Json.dll
0 → 100644
View file @
33564988
File added
DataEditorX/DLL/Newtonsoft.Json.xml
0 → 100644
View file @
33564988
This diff is collapsed.
Click to expand it.
DataEditorX/DataEditorX.csproj
View file @
33564988
...
...
@@ -47,6 +47,9 @@
<HintPath>
DLL\FastColoredTextBox.dll
</HintPath>
</Reference>
<Reference
Include=
"Microsoft.VisualBasic"
/>
<Reference
Include=
"Newtonsoft.Json"
>
<HintPath>
DLL\Newtonsoft.Json.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.configuration"
/>
<Reference
Include=
"System.Data"
/>
...
...
@@ -69,6 +72,7 @@
</Compile>
<Compile
Include=
"Common\CheckUpdate.cs"
/>
<Compile
Include=
"Common\ConfHelper.cs"
/>
<Compile
Include=
"Common\MySortList.cs"
/>
<Compile
Include=
"Common\MyUtils.cs"
/>
<Compile
Include=
"Common\StrUtil.cs"
/>
<Compile
Include=
"Common\XMLReader.cs"
/>
...
...
@@ -115,6 +119,7 @@
<Compile
Include=
"Core\Mse\MSEConfig.cs"
/>
<Compile
Include=
"Core\MyTask.cs"
/>
<Compile
Include=
"Core\TaskHelper.cs"
/>
<Compile
Include=
"Core\TCGEditor\CardSet.cs"
/>
<Compile
Include=
"Core\YGOUtil.cs"
/>
<Compile
Include=
"DataEditForm.cs"
>
<SubType>
Form
</SubType>
...
...
@@ -223,5 +228,8 @@
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Core\TCGEditor"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
DataEditorX/Program.cs
View file @
33564988
...
...
@@ -14,6 +14,7 @@
using
DataEditorX.Config
;
using
DataEditorX.Language
;
namespace
DataEditorX
{
internal
sealed
class
Program
...
...
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