Пример #1
0
        /**
         * Sets this step with the given quest information
         */
        public void setStepWithQuestInfomation(QuestSave saveData)
        {
            Dictionary <StatusCheckable, bool> pairing = new Dictionary <StatusCheckable, bool> ();
            List <StatusSave> statusCheckSaves         = new List <StatusSave> ();

            statusCheckSaves.AddRange(saveData.CurrentStepDataList);
            int counter = 0;

            foreach (KeyValuePair <StatusCheckable, bool> pair in statuses)
            {
                pair.Key.setFromData(statusCheckSaves[counter]);
                pairing.Add(pair.Key, statusCheckSaves[counter].AlreadyMet);
                counter++;
            }

            statuses = pairing;

            List <PointProto> pointProtos = new List <PointProto> ();

            pointProtos.AddRange(saveData.CurrentStepSpawnLocationsList);
            spawnLocations.Clear();
            foreach (PointProto p in pointProtos)
            {
                spawnLocations.Add(new Point(p.X, p.Y));
            }
        }
Пример #2
0
 public static void Load(QuestSave toLoad)
 {
     BasicQuests  = toLoad.BasicQuests;
     CountQuests  = toLoad.CountQuests;
     TieredQuests = toLoad.TieredQuests;
     GotQuestEvent?.Invoke();
 }
Пример #3
0
 public void Set(QuestSave save)
 {
     CompletedQuests = save.CompletedQuests;
     StartedQuests   = save.StartedQuests;
     QuestVariables  = save.QuestVariables;
     CheckNotNullVariables();
     isNewDocument = false;
 }
Пример #4
0
    public void setQuestState(QuestSave save)
    {
        currentStep = save.Step;

        if (!isQuestFinished())
        {
            steps [currentStep].setStepWithQuestInfomation(save);
        }
        else
        {
        }
    }
Пример #5
0
 public FullSave(PlayerSave player, PosSave pos, List <DormSave> dorm, HomeSave parHome, VoreSaves vore, List <TeleportSave> teleportSaves)
 {
     this.playerPart    = player;
     this.posPart       = pos;
     this.dormPart      = dorm;
     this.datePart      = DateSystem.Save;
     this.homePart      = parHome;
     this.voreSaves     = vore;
     this.questSave     = QuestsSystem.Save;
     this.playerFlags   = PlayerFlags.Save();
     this.teleportSaves = teleportSaves;
     this.gameManager   = GameManager.Save();
 }
Пример #6
0
    public QuestSave getQuestData()
    {
        QuestSave.Builder builder = QuestSave.CreateBuilder();
        builder.SetName(name);
        builder.SetStep(currentStep);

        if (!isQuestFinished())
        {
            steps [currentStep].setQuestWithStepInformation(ref builder);
        }

        return(builder.Build());
    }
Пример #7
0
 public void SaveQuests(string characterId, QuestSave questSave)
 {
     lock (sync) {
         var document = questDocuments.FindOne(Query <QuestDocument> .EQ(d => d.characterId, characterId));
         if (document == null)
         {
             document = new QuestDocument {
                 characterId = characterId
             };
         }
         document.isNewDocument = false;
         document.Set(questSave);
         questDocuments.Save(document);
     }
 }