Пример #1
0
        public LessonStage CreateLessonStage()
        {
            LessonStage lessonStage = new LessonStage(m_ShapeActionFactory);

            m_LessonStages.Add(lessonStage);
            lessonStage.SetNum(m_LessonStages.Count - 1);
            lessonStage.BecameDirty += OnBecameDirty;

            return(lessonStage);
        }
Пример #2
0
        public void Remove(LessonStage lessonStage)
        {
            lessonStage.ClearActions();
            m_LessonStages.Remove(lessonStage);
            lessonStage.BecameDirty -= OnBecameDirty;

            for (var i = 0; i < m_LessonStages.Count; i++)
            {
                m_LessonStages[i].SetNum(i);
            }
        }
Пример #3
0
        public void SwapStages(LessonStage lessonStage, bool up)
        {
            int stageIndex     = m_LessonStages.IndexOf(lessonStage);
            int swapStageIndex = stageIndex + (up ? -1 : 1);

            if (swapStageIndex < 0 || swapStageIndex >= m_LessonStages.Count)
            {
                return;
            }

            LessonStage tmp = m_LessonStages[stageIndex];

            m_LessonStages[stageIndex]     = m_LessonStages[swapStageIndex];
            m_LessonStages[swapStageIndex] = tmp;

            for (var i = 0; i < m_LessonStages.Count; i++)
            {
                m_LessonStages[i].SetNum(i);
            }
        }