示例#1
0
        public QuestConditionSet CreateConditionSet()
        {
            var result = new QuestConditionSet();

            CopyTo(result);
            return(result);
        }
 private static void DestroyImmediateConditionSetSubassets(QuestConditionSet conditionSet)
 {
     if (conditionSet == null || conditionSet.conditionList == null)
     {
         return;
     }
     DestroyImmediateQuestSubassetsList(conditionSet.conditionList);
 }
示例#3
0
 private static void AddConditionSetSubassetsToList(QuestConditionSet conditionSet, List <QuestSubasset> subassets)
 {
     if (conditionSet == null || conditionSet.conditionList == null || subassets == null)
     {
         return;
     }
     AddSubassetListSubassetsToList(conditionSet.conditionList, subassets);
 }
示例#4
0
 private static void SaveConditionSetSubassets(Quest questAsset, QuestConditionSet conditionSet)
 {
     if (conditionSet == null || conditionSet.conditionList == null)
     {
         return;
     }
     SaveQuestSubassetsList(questAsset, conditionSet.conditionList);
 }
示例#5
0
 private static void WriteConditionSetDataToStream(BinaryWriter binaryWriter, QuestConditionSet conditionSet)
 {
     if (conditionSet == null)
     {
         return;
     }
     binaryWriter.Write((byte)conditionSet.numTrueConditions);
 }
 public void CloneSubassetsInto(QuestConditionSet copy)
 {
     if (copy == null)
     {
         if (Debug.isDebugBuild)
         {
             Debug.LogWarning("Quest Machine: QuestConditionSet.CloneSubassetsInto() failed because copy is invalid.");
         }
         return;
     }
     copy.conditionList = QuestSubasset.CloneList(conditionList);
 }
示例#7
0
 public void CopyTo(QuestConditionSet conditionSet)
 {
     if (conditionSet == null)
     {
         Debug.LogWarning("Quest Machine: QuestConditionSetProxy.CopyTo destination is null.");
         return;
     }
     conditionSet.conditionList      = QuestConditionProxy.CreateList(conds);
     conditionSet.conditionCountMode = mode;
     conditionSet.minConditionCount  = min;
     conditionSet.numTrueConditions  = numTrue;
 }
示例#8
0
 public void CopyFrom(QuestConditionSet conditionSet)
 {
     if (conditionSet == null)
     {
         Debug.LogWarning("Quest Machine: QuestConditionSetProxy.CopyFrom source is null.");
         return;
     }
     conds   = QuestConditionProxy.NewArray(conditionSet.conditionList);
     mode    = conditionSet.conditionCountMode;
     min     = conditionSet.minConditionCount;
     numTrue = conditionSet.numTrueConditions;
 }
示例#9
0
        /// <summary>
        /// Initializes a quest to empty starting values. Invoked when object is
        /// created by ScriptableObjectUtility.CreateInstance.
        /// </summary>
        public void Initialize()
        {
            // (isInstance & originalAsset are not set here.)
            var instanceID = GetInstanceID();

            id                              = new StringField("Quest" + instanceID);
            title                           = new StringField("Quest " + instanceID);
            icon                            = null;
            group                           = new StringField();
            labels                          = new List <StringField>();
            questGiverID                    = new StringField();
            isTrackable                     = true;
            showInTrackHUD                  = true;
            isAbandonable                   = false;
            rememberIfAbandoned             = false;
            autostartConditionSet           = new QuestConditionSet();
            offerConditionSet               = new QuestConditionSet();
            offerConditionsUnmetContentList = new List <QuestContent>();
            offerContentList                = new List <QuestContent>();
            maxTimes                        = 1;
            timesAccepted                   = 0;
            cooldownSeconds                 = 3600;
            cooldownSecondsRemaining        = 0;
            m_state                         = QuestState.WaitingToStart;
            var numStates = Enum.GetNames(typeof(QuestState)).Length;

            stateInfoList = new List <QuestStateInfo>();
            for (int i = 0; i < numStates; i++)
            {
                stateInfoList.Add(new QuestStateInfo());
            }
            counterList = new List <QuestCounter>();
            var startNode = new QuestNode();

            startNode.InitializeAsStartNode(id.value);
            nodeList = new List <QuestNode>();
            nodeList.Add(startNode);
        }
 public static int ConditionCount(QuestConditionSet conditionSet)
 {
     return((conditionSet != null && conditionSet.conditionList != null) ? conditionSet.conditionList.Count : 0);
 }
示例#11
0
 public QuestConditionSetProxy(QuestConditionSet conditionSet)
 {
     CopyFrom(conditionSet);
 }
示例#12
0
 private static void ReadConditionSetDataFromStream(BinaryReader binaryReader, QuestConditionSet conditionSet)
 {
     conditionSet.numTrueConditions = binaryReader.ReadByte();
 }