Exemplo n.º 1
0
    public void addCostSingle(string type, string amt)
    {
        DictionaryOfStringAndString d = new DictionaryOfStringAndString();

        d.Add(type, amt);
        cost.Add(d);
    }
Exemplo n.º 2
0
    public void testCost()
    {
        DictionaryOfStringAndString d = new DictionaryOfStringAndString();

        d.Add("red", "1");
        d.Add("green", "1");
        d.Add("blue", "1");
        cost.Add(d);
    }
Exemplo n.º 3
0
 public void ParseData(List <Dictionary <string, string> > dataCSV)
 {
     currentLanguageStrings.Clear();
     if (currentLanguageStrings == null)
     {
         currentLanguageStrings = new DictionaryOfStringAndString();
     }
     for (int i = 0; i < dataCSV.Count; i++)
     {
         currentLanguageStrings.Add(dataCSV[i][CsvKeyConstant.LOCALIZE_KEY], dataCSV[i][CsvKeyConstant.LOCALIIZE_VALUE]);
     }
 }
Exemplo n.º 4
0
    public CardCost deepCopy()
    {
        CardCost c = new CardCost();

        foreach (DictionaryOfStringAndString cos in cost)
        {
            DictionaryOfStringAndString newD = new DictionaryOfStringAndString();

            foreach (KeyValuePair <string, string> attach in cos)
            {
                newD.Add(attach.Key, attach.Value);
            }
            c.addCostDict(newD);
        }
        return(c);
    }
Exemplo n.º 5
0
    float getStat(DictionaryOfStringAndString loc, string st)
    {
        DictionaryOfStringAndString loc2 = getTemp(loc);
        float ini = 0.0f;

        if (loc.ContainsKey(st))
        {
            ini += parseNum(character, loc[st]);
        }
        if (!loc2.ContainsKey(st))
        {
            addTempStat(loc2, st);
        }
        ini += parseNum(character, loc2[st]);
        return(ini);
    }
Exemplo n.º 6
0
    void setStat(DictionaryOfStringAndString loc, string st, float val)
    {
        DictionaryOfStringAndString loc2 = getTemp(loc);

        float ini = 0.0f;

        if (!loc2.ContainsKey(st))
        {
            addTempStat(loc2, st);
        }

        ini = parseNum(character, loc2[st]);
        float nw = ini + val;

        loc[st] = nw.ToString(roundS);
    }
Exemplo n.º 7
0
    void basicStats()
    {
        baseStats      = new DictionaryOfStringAndString();
        damageType     = new DictionaryOfStringAndString();
        resistType     = new DictionaryOfStringAndString();
        baseStatsTemp  = new DictionaryOfStringAndString();
        damageTypeTemp = new DictionaryOfStringAndString();
        resistTypeTemp = new DictionaryOfStringAndString();
        startDeck      = new DictionaryOfStringAndString();

        baseStats.Add("maxhealth", "100");
        baseStats.Add("initiative", "0");
        baseStats.Add("luck", "0");
        baseStats.Add("handsize", "10");
        baseStats.Add("damage", "100");
        baseStats.Add("resist", "100");
        baseStats.Add("resistTypeStart", "0");
        setStat(baseStats, "health", getStat(baseStats, "maxhealth"));
        basicResist();
        basicDeck();
    }
Exemplo n.º 8
0
    DictionaryOfStringAndString getTemp(DictionaryOfStringAndString loc)
    {
        DictionaryOfStringAndString loc2;

        if (loc == baseStats)
        {
            loc2 = baseStatsTemp;
        }
        else if (loc == damageType)
        {
            loc2 = damageTypeTemp;
        }
        else if (loc == resistType)
        {
            loc2 = resistTypeTemp;
        }
        else
        {
            return(null);
        }

        return(loc2);
    }
Exemplo n.º 9
0
    public Deck createDeck(DictionaryOfStringAndString de, Character c)
    {
        Deck d = new Deck(c);

        foreach (var key in de.Keys)
        {
            int num = (int)Mathf.Round(parseNum(c, c, de[key]));


            for (int i = 0; i < num; i++) //Error messages on this line
            {
                Card card = save.loadCardJSON(key);
                if (card != null)
                {
                    d.addCard(card);
                }
                else
                {
                    Debug.Log("Card " + key + " not found");
                }
            }
        }
        return(d);
    }
Exemplo n.º 10
0
    void setupDeck()
    {
        DictionaryOfStringAndString deckdict = stats.getStartDeck();

        deckBattle = game.createDeck(deckdict, this);
    }
Exemplo n.º 11
0
 public void addCostDict(DictionaryOfStringAndString d)
 {
     cost.Add(d);
 }
Exemplo n.º 12
0
 void addTempStat(DictionaryOfStringAndString loc, string st)
 {
     loc.Add(st, "0");
 }