Exemplo n.º 1
0
        public void Add(Quest quest)
        {
            if (quest == null)
            {
                Log.Error("Tried to add a null quest.");
                return;
            }
            if (Contains(quest))
            {
                Log.Error("Tried to add the same quest twice: " + quest.ToStringSafe());
                return;
            }
            quests.Add(quest);
            AddToCache(quest);
            Find.SignalManager.RegisterReceiver(quest);
            List <QuestPart> partsListForReading = quest.PartsListForReading;

            for (int i = 0; i < partsListForReading.Count; i++)
            {
                partsListForReading[i].PostQuestAdded();
            }
            if (quest.initiallyAccepted)
            {
                quest.Initiate();
            }
        }
Exemplo n.º 2
0
 public void Remove(Quest quest)
 {
     if (!Contains(quest))
     {
         Log.Error("Tried to remove non-existent quest: " + quest.ToStringSafe());
         return;
     }
     quests.Remove(quest);
     RemoveFromCache(quest);
     Find.SignalManager.DeregisterReceiver(quest);
 }