public void AddQuest(Quest quest)
        {
            GameObject questComponentObj = GameObject.Instantiate(questComponentTemplate, transform);

            questComponentObj.transform.SetAsFirstSibling();
            QuestComponent questComponent = questComponentObj.GetComponent <QuestComponent>();

            questComponent.Initialize(quest);

            quest.OnTaskProgressed     += OnTaskProgress;
            quest.OnTaskCompleted      += OnTaskCompleted;
            quest.OnObjectiveCompleted += OnObjectiveCompleted;
            quest.OnQuestCompleted     += OnQuestCompleted;

            _questComponents.Add(quest.ID, questComponent);
        }
        void UpdateQuestCounter(Entity quest_entity, QuestComponent quest, GameEvent ev)
        {
            var counters = EntityManager.GetBuffer <QuestCounterComponent>(quest_entity);

            for (var i = 0; i < counters.Length; i++)
            {
                var counter = counters[i];

                if (counter.LocationID == ev.LocationID &&
                    counter.TypeID == ev.TypeID &&
                    counter.CurrentCount < counter.TargetCount)
                {
                    counter.CurrentCount++;
                    counters[i] = counter;

                    if (!EntityManager.HasComponent <QuestChangeEvent>(quest_entity))
                    {
                        PostUpdateCommands.AddComponent <QuestChangeEvent>(quest_entity);
                    }
                }
            }
        }