Exemplo n.º 1
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());
    }
Exemplo n.º 2
0
        /**
         * Sets teh given quest save data protobuf with this step information
         */
        public void setQuestWithStepInformation(ref QuestSave.Builder builder)
        {
            foreach (KeyValuePair <StatusCheckable, bool> pair in statuses)
            {
                StatusSave.Builder sBuilder = StatusSave.CreateBuilder();
                sBuilder.SetAlreadyMet(pair.Value);
                pair.Key.setBuilderWithData(ref sBuilder);
                builder.AddCurrentStepData(sBuilder.Build());
            }

            foreach (Point p in spawnLocations)
            {
                PointProto.Builder pBuilder = PointProto.CreateBuilder();
                pBuilder.SetX(p.x);
                pBuilder.SetY(p.y);
                builder.AddCurrentStepSpawnLocations(pBuilder.Build());
            }
        }