Example #1
0
    public IQuiz random_quiz()
    {
        List <IQuizSource> sources_list = new List <IQuizSource>(sources);
        int         index = (int)Random.Range(0f, (float)sources_list.Count);
        IQuizSource src   = sources_list[index];

        return(src.create_quiz(src.random_id()));
    }
Example #2
0
    public IQuizSource[] quiz_sources(string category, string theme, string quiz_name)
    {
        /// Returns an array of all quiz sources having this name in the theme in the category in the registry
        SortedSet <IQuizSource> ret = new SortedSet <IQuizSource>();

        foreach (IQuizSource src in sources)
        {
            if (src.category == category && src.theme == theme && src.quiz_name == quiz_name)
            {
                ret.Add(src);
            }
        }
        IQuizSource[] result = new IQuizSource[ret.Count];
        ret.CopyTo(result, 0);
        return(result);
    }