コード例 #1
0
ファイル: TaskPresenter.cs プロジェクト: hamk-uas/vikke-game
    /// <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);
    }
コード例 #2
0
    /// <summary>
    /// Constructor for <see cref="LocationlistPresenter"/>
    /// </summary>
    /// <param name="locationlistView">Reference to the <see cref="LocationlistView"/></param>
    public LocationlistPresenter(LocationlistView locationlistView)
    {
        _locationlistView = locationlistView;

        //Fetch the StoryModel instance
        _storyModel = StoryModel.GetInstance();

        //Fetch a reference to the currenctly active Story
        _story = _storyModel.GetActiveStory();

        //Set the view content
        _locationlistView.SetViewTitle(_story.GetLocalizedTitle());
        _locationlistView.SetLocationsImage(_story.locationMapSprite);
        PopulateLocationList(_story);
    }