Exemplo n.º 1
0
    /// <summary>
    /// Defauly constructor
    /// </summary>
    /// <param name="taskView">Reference of the view for this class</param>
    public TaskPresenter(TaskView taskView)
    {
        _taskView = taskView;

        //Fetch the model instances
        _locationModel = LocationModel.GetInstance();
        _storyModel    = StoryModel.GetInstance();
        //Get the active story
        _activeStory = _storyModel.GetActiveStory();
        //Get the active task
        _task = _locationModel.GetLocationTask();

        //Apply image content depending on of the task has an image or not
        if (_task.taskviewSprite != null)
        {
            _taskView.SetTaskContent(_task.GetLocalizedTitle(), _task.taskviewSprite, _task.GetLocalizedText());
        }
        else
        {
            _taskView.SetTaskContent(_task.GetLocalizedTitle(), _task.GetLocalizedText());
        }

        //Display the AR scanner button if the task has AR content
        _taskView.SetARScannerBtnActive(_task.isARTask);
    }