Commit c34dc5fa authored by keyongyu's avatar keyongyu

fix

parent 747d0872
......@@ -11,7 +11,7 @@
using DataEditorX.Core;
using System.Text;
namespace DataEditorX.Core
namespace DataEditorX.Config
{
class CodeConfig
{
......
......@@ -30,12 +30,21 @@ class MyConfig
public const string FILE_TEMP = "open.tmp";
public const string FILE_MESSAGE = "message.txt";
public const string FILE_HISTORY = "history.txt";
public static string FILE_INFO = "card-info.txt";
public static string FILE_SETNAME = "card-setname.txt";
public static string TAG_RULE = "rule";
public static string TAG_RACE = "race";
public static string TAG_ATTRIBUTE = "attribute";
public static string TAG_LEVEL = "level";
public static string TAG_CATEGORY = "category";
public static string TAG_TYPE = "type";
public static string readString(string key)
{
return ConfigurationManager.AppSettings[key];
}
public static int readInteger(string key,int def)
public static int readInteger(string key, int def)
{
int i;
if (int.TryParse(readString(key), out i))
......@@ -44,7 +53,7 @@ public static int readInteger(string key,int def)
}
public static float readFloat(string key, float def)
{
float i;
float i;
if (float.TryParse(readString(key), out i))
return i;
return def;
......
......@@ -8,14 +8,16 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace DataEditorX.Core
namespace DataEditorX.Config
{
/// <summary>
/// Description of DataConfig.
/// </summary>
public class DataConfig
{
public DataConfig()
{
InitMember(System.Windows.Forms.Application.StartupPath);
......@@ -24,16 +26,10 @@ public DataConfig(string datapath)
{
InitMember(datapath);
}
void InitMember(string datapath)
public void InitMember(string datapath)
{
this.datapath = datapath;
confrule = Path.Combine(datapath, "card-rule.txt");
confattribute = Path.Combine(datapath, "card-attribute.txt");
confrace = Path.Combine(datapath, "card-race.txt");
conflevel = Path.Combine(datapath, "card-level.txt");
confsetname = Path.Combine(datapath, "card-setname.txt");
conftype = Path.Combine(datapath, "card-type.txt");
confcategory = Path.Combine(datapath, "card-category.txt");
conf = MyPath.Combine(datapath, MyConfig.FILE_INFO);
dicCardRules=new Dictionary<long, string>();
dicSetnames=new Dictionary<long, string>();
......@@ -42,6 +38,17 @@ void InitMember(string datapath)
dicCardAttributes=new Dictionary<long, string>();
dicCardRaces=new Dictionary<long, string>();
dicCardLevels=new Dictionary<long, string>();
string[] lines = File.ReadAllLines(conf, Encoding.UTF8);
foreach (string line in lines)
{
if (!line.StartsWith("#"))
{
if (line.StartsWith(MyConfig.TAG_ATTRIBUTE))
{
}
}
}
}
Dictionary<long, string> CopyDic(Dictionary<long, string> dic)
{
......@@ -63,8 +70,7 @@ public void Init()
dicCardLevels=DataManager.Read(conflevel);
}
string datapath;
public string confrule, confattribute, confrace, conflevel;
public string confsetname, conftype, confcategory;
public string conf;
public Dictionary<long, string> dicCardRules=null;
public Dictionary<long, string> dicCardAttributes=null;
......
......@@ -11,7 +11,7 @@
using System.Globalization;
using System.Collections.Generic;
namespace DataEditorX.Core
namespace DataEditorX.Config
{
public class DataManager
{
......
......@@ -10,7 +10,7 @@
using DataEditorX.Config;
using DataEditorX.Common;
namespace DataEditorX.Core
namespace DataEditorX.Config
{
public class ImageSet
......
......@@ -12,7 +12,7 @@
using System.Text;
using DataEditorX.Language;
namespace DataEditorX.Core
namespace DataEditorX.Config
{
public class RegStr
{
......
......@@ -90,7 +90,7 @@
<Compile Include="Config\CodeConfig.cs" />
<Compile Include="Core\DataBase.cs" />
<Compile Include="Config\DataConfig.cs" />
<Compile Include="Core\DataManager.cs" />
<Compile Include="Config\DataManager.cs" />
<Compile Include="Config\ImageSet.cs" />
<Compile Include="Core\LuaFunction.cs" />
<Compile Include="Core\MSE.cs" />
......@@ -338,6 +338,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="chinese\card-info.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
#rule
rule 0x0 卡片规则
rule 0x1 OCG专有
rule 0x2 TCG专有
rule 0x3 OCG&TCG
rule 0x4 Anime/DIY
#attribute
attribute 0x0 卡片属性
attribute 0x1 地
attribute 0x2 水
attribute 0x4 炎
attribute 0x8 风
attribute 0x10 光
attribute 0x20 暗
attribute 0x40 神
#level
level 0x0 卡片等级/阶级
level 0x1 1★
level 0x2 2★
level 0x3 3★
level 0x4 4★
level 0x5 5★
level 0x6 6★
level 0x7 7★
level 0x8 8★
level 0x9 9★
level 0xa 10★
level 0xb 11★
level 0xc 12★
level 0xd 13★
#category
category 0x1 魔陷破坏
category 0x2 怪兽破坏
category 0x4 卡片除外
category 0x8 送去墓地
category 0x10 返回手牌
category 0x20 返回卡组
category 0x40 手牌破坏
category 0x80 卡组破坏
category 0x100 抽卡辅助
category 0x200 卡组检索
category 0x400 卡片回收
category 0x800 表示变更
category 0x1000 控制权
category 0x2000 攻守变化
category 0x4000 贯穿伤害
category 0x8000 多次攻击
category 0x10000 攻击限制
category 0x20000 直接攻击
category 0x40000 特殊召唤
category 0x80000 衍生物
category 0x100000 种族相关
category 0x200000 属性相关
category 0x400000 LP伤害
category 0x800000 LP回复
category 0x1000000 破坏耐性
category 0x2000000 效果耐性
category 0x4000000 指示物
category 0x8000000 赌博相关
category 0x10000000 融合相关
category 0x20000000 同调相关
category 0x40000000 超量相关
category 0x80000000 效果无效
#race
race 0x0 卡片种族
race 0x1 战士族
race 0x2 魔法师族
race 0x4 天使族
race 0x8 恶魔族
race 0x10 不死族
race 0x20 机械族
race 0x40 水族
race 0x80 炎族
race 0x100 岩石族
race 0x200 鸟兽族
race 0x400 植物族
race 0x800 昆虫族
race 0x1000 雷族
race 0x2000 龙族
race 0x4000 兽族
race 0x8000 兽战士族
race 0x10000 恐龙族
race 0x20000 鱼族
race 0x40000 海龙族
race 0x80000 爬虫类族
race 0x100000 念动力族
race 0x200000 幻神兽族
race 0x400000 创造神族
race 0x800000 幻龙族
#type
type 0x1 怪兽
type 0x2 魔法
type 0x4 陷阱
type 0x8 N/A
type 0x10 通常
type 0x20 效果
type 0x40 融合
type 0x80 仪式
type 0x100 N/A
type 0x200 灵魂
type 0x400 同盟
type 0x800 二重
type 0x1000 调整
type 0x2000 同调
type 0x4000 衍生物
type 0x8000 N/A
type 0x10000 速攻
type 0x20000 永续
type 0x40000 装备
type 0x80000 场地
type 0x100000 反击
type 0x200000 反转
type 0x400000 卡通
type 0x800000 超量
type 0x1000000 灵摆
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment