Skip to content

Synergy Processor class

eunzee edited this page Oct 28, 2022 · 1 revision

๐Ÿงธ public class SynergyProcessor

synergy ๋ฐ์ดํ„ฐ(์ด๋ฆ„, ์กฐ๊ฑด, ์˜ํ–ฅ)๋ฅผ csv ํŒŒ์ผ๋กœ๋ถ€ํ„ฐ ๋ถˆ๋Ÿฌ์˜ค๊ณ , ๊ฐ๊ฐ ์“ฐ๊ธฐ ํŽธํ•˜๊ฒŒ ์ €์žฅํ•œ๋‹ค. ์‹œ๋„ˆ์ง€๋ฅผ ๊ณ„์‚ฐํ•˜๊ณ  ์ ์šฉํ•˜๋Š” ์—ญํ• ๋„ ํ•œ๋‹ค.

๐Ÿ“class generator

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

๐Ÿ“Constants

  • SYNERGY_NUM = 10
  • SEONBAE_NUM = 29

๐Ÿ“Get Functions

์ด ํด๋ž˜์Šค์˜ private ๋ณ€์ˆ˜๋ฅผ ์ฝ๊ณ  ์‹ถ์„ ๋•Œ๋Š” ์ง์ ‘ ์ ‘๊ทผํ•  ์ˆ˜ ์—†๊ณ  get ํ•จ์ˆ˜๋“ค์„ ํ†ตํ•ด ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.

function name return type description variable
public GetSynergyCondition() List<int> ํ•œ ๊ฐœ์˜ ์‹œ๋„ˆ์ง€์˜ ์กฐ๊ฑด๋“ค์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. int synergyId
public GetSynergyName string ํ•œ ๊ฐœ์˜ ์‹œ๋„ˆ์ง€์˜ ์ด๋ฆ„์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. int synergyId

๐Ÿ“Public Functions

CallSynergy(int synergyId, int[] fieldSeonbae)

Clone this wiki locally