示例#1
0
        public void Read(format_tsf stream)
        {
            this.test_name       = stream.ReadString();
            this.test_message    = stream.ReadString();
            this.test_level      = stream.ReadString();
            this.test_start_time = new DateTime(stream.ReadLong());
            this.result          = stream.ReadInt();
            int num = stream.ReadInt();

            this.question_results.Clear();
            for (int i = 0; i < num; i++)
            {
                test_question_result item = new test_question_result {
                    themeId    = stream.ReadShort(),
                    questionId = stream.ReadShort()
                };
                item.answerId.Clear();
                byte num3 = stream.ReadByte();
                for (int j = 0; j < num3; j++)
                {
                    item.answerId.Add(stream.ReadByte());
                }
                item.timeSpent = stream.ReadInt();
                this.question_results.Add(item);
            }
        }
示例#2
0
 public void Precache(format_tsf stream)
 {
     stream.PrecacheString(this.name);
     stream.PrecacheString(this.question);
     stream.PrecacheString(this.image_filename);
     for (int i = 0; i < this.answers.Count; i++)
     {
         stream.PrecacheString(this.answers[i].answer);
     }
 }
示例#3
0
 public void Save(format_tsf stream)
 {
     stream.Write(this.name);
     stream.Write(this.question);
     stream.Write(this.image_filename);
     stream.Write(this.max_answers);
     stream.Write(this.answers.Count);
     for (int i = 0; i < this.answers.Count; i++)
     {
         stream.Write(this.answers[i].answer);
         stream.Write(this.answers[i].is_right);
     }
 }
示例#4
0
        public void Precache(format_tsf stream)
        {
            int num;

            stream.PrecacheString(this.name);
            for (num = 0; num < this.levels.Count; num++)
            {
                stream.PrecacheString(this.levels[num]);
            }
            for (num = 0; num < this.questions.Count; num++)
            {
                this.questions[num].Precache(stream);
            }
        }
示例#5
0
        public void Save(format_tsf stream)
        {
            int num;

            stream.Write(this.name);
            stream.Write(this.levels.Count);
            for (num = 0; num < this.levels.Count; num++)
            {
                stream.Write(this.levels[num]);
            }
            stream.Write(this.questions.Count);
            for (num = 0; num < this.questions.Count; num++)
            {
                this.questions[num].Save(stream);
            }
        }
示例#6
0
        public void Read(format_tsf stream)
        {
            this.name           = stream.ReadString();
            this.question       = stream.ReadString();
            this.image_filename = stream.ReadString();
            this.max_answers    = stream.ReadInt();
            int num = stream.ReadInt();

            this.answers.Clear();
            for (int i = 0; i < num; i++)
            {
                test_answer item = new test_answer {
                    answer   = stream.ReadString(),
                    is_right = stream.ReadBool()
                };
                this.answers.Add(item);
            }
        }
示例#7
0
 public void Save(format_tsf stream)
 {
     stream.Write(this.test_name);
     stream.Write(this.test_message);
     stream.Write(this.test_level);
     stream.Write(this.test_start_time.Ticks);
     stream.Write(this.result);
     stream.Write(this.question_results.Count);
     for (int i = 0; i < this.question_results.Count; i++)
     {
         stream.Write(this.question_results[i].themeId);
         stream.Write(this.question_results[i].questionId);
         stream.Write((byte)this.question_results[i].answerId.Count);
         for (int j = 0; j < this.question_results[i].answerId.Count; j++)
         {
             stream.Write(this.question_results[i].answerId[j]);
         }
         stream.Write(this.question_results[i].timeSpent);
     }
 }
示例#8
0
        public void Read(format_tsf stream)
        {
            int num2;

            this.name = stream.ReadString();
            int num = stream.ReadInt();

            this.levels.Clear();
            for (num2 = 0; num2 < num; num2++)
            {
                this.levels.Add(stream.ReadString());
            }
            int num3 = stream.ReadInt();

            this.questions.Clear();
            for (num2 = 0; num2 < num3; num2++)
            {
                test_question item = new test_question();
                item.Read(stream);
                this.questions.Add(item);
            }
        }
示例#9
0
 public void Precache(format_tsf stream)
 {
     stream.PrecacheString(this.test_name);
     stream.PrecacheString(this.test_message);
     stream.PrecacheString(this.test_level);
 }