Book Image

Mastering LibGDX Game Development

By : Patrick Hoey
Book Image

Mastering LibGDX Game Development

By: Patrick Hoey

Overview of this book

Table of Contents (18 chapters)
Mastering LibGDX Game Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

The dependency graph implementation


With the fundamentals of the dependency graph covered, we will now take a look at the high-level class diagram (Figure 4), which describes the new classes and relationships for implementing the quest system:

Figure 4

The left-half of this class diagram represents the notification propagation via the observer pattern. For instance, when the player entity selects a quest item or walks over a designated quest task area, those notifications bubble up to the PlayerHUD, which is an observer for those ComponentEvent notifications. Depending on the type of notification trigger, this will get passed to the QuestUI to update the current quests. This mechanism has been described in more detail in the previous chapters.

From Figure 4, we can see how QuestUI loads QuestGraph, one graph for each quest. Each QuestGraph is composed of multiple QuestTask and QuestTaskDependency objects. The QuestTask objects represent the dependency graph vertices. The QuestTaskDependency...