Example #1
0
        protected T GetController <T>() where T : PluginController
        {
            PluginController controller;

            if (typeof(T) == typeof(DisciplineController))
            {
                controller = new DisciplineController(this.DisciplineStorage);
            }
            else if (typeof(T) == typeof(ChapterController))
            {
                controller = new ChapterController(this.DisciplineStorage);
            }
            else if (typeof(T) == typeof(TopicController))
            {
                controller = new TopicController(this.DisciplineStorage);
            }
            else if (typeof(T) == typeof(CurriculumController))
            {
                controller = new CurriculumController(this.CurriculumStorage);
            }
            else if (typeof(T) == typeof(CurriculumChapterController))
            {
                controller = new CurriculumChapterController(this.CurriculumStorage);
            }
            else if (typeof(T) == typeof(CurriculumChapterTopicController))
            {
                controller = new CurriculumChapterTopicController(this.CurriculumStorage);
            }
            else
            {
                throw new NotImplementedException();
            }

            var mocks = new ContextMocks(controller);

            mocks.RouteData.Values["action"]     = "Index";
            mocks.RouteData.Values["controller"] = typeof(T).Name;
            return((T)controller);
        }
Example #2
0
    void Start()
    {
        fpsController = GameObject.FindGameObjectWithTag ("Player").GetComponent<FirstPersonController>();
        playerCamera = GameObject.Find ("FPSController").GetComponentInChildren<Camera> ();
        curriculum = GetComponentInChildren<CurriculumController> ();
        pictureFrame = GetComponentInChildren<DeskPictureFrameController> ();

        curriculum.setDeskController (this);
        pictureFrame.setDeskController (this);
        state = PlayerDeskState.NONE;

        foreach (Transform t in transform)
        {
            if(t.name == "Lecturer") {
                lecturer = t;
                break;
            }
        }
    }