- 매수 기능 추가
This commit is contained in:
21
Config.cs
21
Config.cs
@@ -15,6 +15,7 @@ namespace NewsCrawler
|
||||
public static void Init()
|
||||
{
|
||||
m_Data.Add("manual-price", "100000");
|
||||
m_Data.Add("buy-price", "1000000");
|
||||
Load();
|
||||
}
|
||||
|
||||
@@ -24,8 +25,6 @@ namespace NewsCrawler
|
||||
if(File.Exists(strPath) == false)
|
||||
return;
|
||||
|
||||
m_Data.Clear();
|
||||
|
||||
string[] aLines = File.ReadAllLines(strPath);
|
||||
foreach(string strLine in aLines)
|
||||
{
|
||||
@@ -36,7 +35,10 @@ namespace NewsCrawler
|
||||
if(aTokens.Length < 2)
|
||||
continue;
|
||||
|
||||
m_Data.Add(aTokens[0], aTokens[1]);
|
||||
if(m_Data.ContainsKey(aTokens[0]) == true)
|
||||
m_Data[aTokens[0]] = aTokens[1];
|
||||
else
|
||||
m_Data.Add(aTokens[0], aTokens[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,5 +64,18 @@ namespace NewsCrawler
|
||||
m_Data["manual-price"] = iPrice.ToString();
|
||||
Save();
|
||||
}
|
||||
|
||||
public static int GetBuyPrice()
|
||||
{
|
||||
int iPrice;
|
||||
int.TryParse(m_Data["buy-price"], out iPrice);
|
||||
return iPrice;
|
||||
}
|
||||
|
||||
public static void SetBuyPrice(int iPrice)
|
||||
{
|
||||
m_Data["buy-price"] = iPrice.ToString();
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user