Im abit confused by tge Setup method here

Doesn’t this seem a bit …janky…

 public void Setup(QuestStatus status)
    {
        this._status = status;
        _title.text = status.GetQuest().GetTitle();
        _progress.text = "0/" + status.GetQuest().GetObjectiveCount();
    }

unless i’m misunderstanding this dependency flow its…

Quest item UI > Quest Status > Quest

It isnt bad i guess but it feels wrong. why not just have the scriptable objects populate dictionary values and use the dictionary as a status lookup. probably use a bool to track quest status or something like that.
…idk maybe my way is more complicated… am i misunderstanding how this is used?

The Quest Status contains the list of objectives that have been completed, and by it’s very existence, also determines if the quest has been accepted. My only fault with the Setup is that it breaks the Law of Demeter. In other words, the QuestStatus should have pass through functions to get the title and objective count, and the Setup should call those methods instead of method chaining to get the information from the Quest directly.

Now you could set up a Dictionary with the information, but as the QuestStatus must know which Quest it’s the Status for, I’m not sure if it would be a time saver or not.

Demeter is what i was getting at with the dependency flow. grabbing directly was my first thought but then i thought dictionary with unique ID like we did in inventory system…it might be more complicated though…

im chasing a null reference in this one currently if i end up giving up you’ll probably hear more from me tomorrow lol.

1 Like

@Brian_Trotter … i was clicking the guards out of order which forced the null. probably should put in a null check to avoid that but LOL i chased that error around for 3 hours just to realize it was because i needed to talk to enemy 8 to start quest then enemy 6 to get the checkmark. not my finest work.

Privacy & Terms