-
Notifications
You must be signed in to change notification settings - Fork 1
Synergy Processor class
eunzee edited this page Oct 28, 2022
·
1 revision
synergy ๋ฐ์ดํฐ(์ด๋ฆ, ์กฐ๊ฑด, ์ํฅ)๋ฅผ csv ํ์ผ๋ก๋ถํฐ ๋ถ๋ฌ์ค๊ณ , ๊ฐ๊ฐ ์ฐ๊ธฐ ํธํ๊ฒ ์ ์ฅํ๋ค. ์๋์ง๋ฅผ ๊ณ์ฐํ๊ณ ์ ์ฉํ๋ ์ญํ ๋ ํ๋ค.
synergy.csv์ synergyEffect.csv ํ์ผ์ ์ฝ๊ณ ์ธ ๊ฐ์ ๋ณ์(private)์ ๋๋ ์ ์ ์ฅํ๋ค.
public SynergyProcessor()
{
List<Dictionary<string, string>> synergy_reader = CSVReader.ReadByString("synergy");
synergyEffect = CSVReader.ReadByFloat("synergyEffect");
// load synergy csv file
for (int i = 0; i < SYNERGY_NUM; i++)
{
synergyNames[i] = synergy_reader[i]["synergy"]; // save synergy names
string sSynergy = synergy_reader[i]["key"];
List<int> nArraySynergy = sSynergy.Split(',').Select(Int32.Parse).ToList();
synergyConditions.Add(nArraySynergy);
}
}
-
List<List<int>> synergyConditions
: ์๋์ง ๋ฐ๋ ์กฐ๊ฑด ๋ฆฌ์คํธ(2์ฐจ์) -
Dictionary<int, string> synergyNames
: ์๋์ง ์ด๋ฆ ๋์ ๋๋ฆฌ -
List<Dictionary<string, float>> synergyEffect
: ์๋์ง ํจ๊ณผ ๋ฆฌ์คํธ(,๋์ ๋๋ฆฌ)
usage:
SynergyProcessor synergyProcessor = new SynergyProcessor();
SYNERGY_NUM = 10
SEONBAE_NUM = 29
์ด ํด๋์ค์ private ๋ณ์๋ฅผ ์ฝ๊ณ ์ถ์ ๋๋ ์ง์ ์ ๊ทผํ ์ ์๊ณ get ํจ์๋ค์ ํตํด ๋ฐ์ ์ ์๋ค.
function name | return type | description | variable |
---|---|---|---|
public GetSynergyCondition() | List<int> | ํ ๊ฐ์ ์๋์ง์ ์กฐ๊ฑด๋ค์ ๋ฐํํ๋ค. | int synergyId |
public GetSynergyName | string | ํ ๊ฐ์ ์๋์ง์ ์ด๋ฆ์ ๋ฐํํ๋ค. | int synergyId |