Esempio n. 1
0
    /* ==========================================================================================================
     * CLASS METHODS
     * ==========================================================================================================
     */

    /// <summary>
    /// Create all possible combinations of persons
    /// </summary>
    void GenerateAllPossiblePersons()
    {
        for (int nHeadIdx = 0; nHeadIdx < headColors.Length; nHeadIdx++)
        {
            for (int nTorsoIdx = 0; nTorsoIdx < torsoColors.Length; nTorsoIdx++)
            {
                for (int nLegsIdx = 0; nLegsIdx < legsColors.Length; nLegsIdx++)
                {
                    for (int nShoesIdx = 0; nShoesIdx < shoesColors.Length; nShoesIdx++)
                    {
                        // Generate the person
                        //string stGeneratedId = nHeadIdx.ToString() + nTorsoIdx.ToString() + nLegsIdx.ToString() + nShoesIdx.ToString();
                        //CPerson person = new CPerson();
                        //person.stPersonColors = new Color[] { headColors[nHeadIdx], torsoColors[nTorsoIdx], legsColors[nLegsIdx], shoesColors[nShoesIdx] }; // Unique color combination

                        // Add the person to the list
                        //ltPersons.Add(person);
                        CPersonColors personColor = new CPersonColors();
                        personColor.uniquePersonColors = new Color[] { headColors[nHeadIdx], torsoColors[nTorsoIdx], legsColors[nLegsIdx], shoesColors[nShoesIdx] };                         // Unique color combination
                        ltPersonsColors.Add(personColor);
                    }
                }
            }
        }

        // DEBUG
        Debug.Log(this.transform + " People generated: " + ltPersonsColors.Count);
    }
    /* ==========================================================================================================
     * CLASS METHODS
     * ==========================================================================================================
     */
    /// <summary>
    /// Create all possible combinations of persons
    /// </summary>
    void GenerateAllPossiblePersons()
    {
        for(int nHeadIdx = 0; nHeadIdx < headColors.Length; nHeadIdx++) {

            for(int nTorsoIdx = 0; nTorsoIdx < torsoColors.Length; nTorsoIdx++) {

                for(int nLegsIdx = 0; nLegsIdx < legsColors.Length; nLegsIdx++) {

                    for(int nShoesIdx = 0; nShoesIdx < shoesColors.Length; nShoesIdx++) {

                        // Generate the person
                        //string stGeneratedId = nHeadIdx.ToString() + nTorsoIdx.ToString() + nLegsIdx.ToString() + nShoesIdx.ToString();
                        //CPerson person = new CPerson();
                        //person.stPersonColors = new Color[] { headColors[nHeadIdx], torsoColors[nTorsoIdx], legsColors[nLegsIdx], shoesColors[nShoesIdx] }; // Unique color combination

                        // Add the person to the list
                        //ltPersons.Add(person);
                        CPersonColors personColor = new CPersonColors();
                        personColor.uniquePersonColors = new Color[] { headColors[nHeadIdx], torsoColors[nTorsoIdx], legsColors[nLegsIdx], shoesColors[nShoesIdx] }; // Unique color combination
                        ltPersonsColors.Add(personColor);
                    }
                }
            }
        }

        // DEBUG
        Debug.Log(this.transform + " People generated: " + ltPersonsColors.Count);
    }