Exemple #1
0
    public static Adjective GetRandom(string _name)
    {
        AdjectiveGroup adjectiveGroup = adjectiveGroups.Find(x => x.name == _name);

        if (adjectiveGroup == null)
        {
            Debug.LogError("couldn't find adjective group : " + _name);
            adjectiveGroup = adjectiveGroups[0];
        }

        return(adjectiveGroup.adjectives[Random.Range(0, adjectiveGroup.adjectives.Count)]);
    }
Exemple #2
0
    public static List <Adjective> GetAll(string _name)
    {
        AdjectiveGroup adjectiveGroup = adjectiveGroups.Find(x => x.name == _name);


        if (adjectiveGroup == null)
        {
            Debug.LogError("couldn't find adjective group : " + _name);
            adjectiveGroup = adjectiveGroups[0];
        }
        List <Adjective> adjectives = new List <Adjective>(adjectiveGroup.adjectives);

        return(adjectives);
    }
Exemple #3
0
    public override void GetCell(int rowIndex, List <string> cells)
    {
        base.GetCell(rowIndex, cells);

        if (rowIndex == 0)
        {
            foreach (var cell in cells)
            {
                AdjectiveGroup adjectiveGroup = new AdjectiveGroup();
                adjectiveGroup.name = cell.ToLower();

                Adjective.adjectiveGroups.Add(adjectiveGroup);
            }
        }
        else
        {
            for (int cellIndex = 0; cellIndex < cells.Count; cellIndex++)
            {
                if (string.IsNullOrEmpty(cells[cellIndex]))
                {
                    continue;
                }

                Adjective newAdjective = new Adjective();

                newAdjective._text = cells[cellIndex];
                if (newAdjective._text.Contains("("))
                {
                    newAdjective.beforeWord = true;
                    newAdjective._text      = newAdjective._text.Replace("(", "");
                }

                Adjective.adjectiveGroups[cellIndex].adjectives.Add(newAdjective);
            }
        }
    }