- 매수 기능 추가

This commit is contained in:
2016-12-09 09:51:00 +09:00
parent 958f523b9c
commit 034c061a1b
12 changed files with 482 additions and 20 deletions

View File

@@ -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();
}
}
}