Esempio n. 1
0
        /// <summary>
        /// 获得对话影响所有的演员Uid
        /// </summary>
        /// <param name="addDialogInfo"></param>
        /// <param name="dialogModel"></param>
        /// <returns></returns>
        private List <int> GetDialogActorUids(AddDialogInfo addDialogInfo, DialogModel dialogModel)
        {
            List <int> actorUids = new List <int>();

            if (addDialogInfo.Sponsor != null)
            {
                actorUids.Add(addDialogInfo.Sponsor.Uid);
            }
            if (addDialogInfo.Targets != null && addDialogInfo.Targets.Count > 0)
            {
                for (int i = 0; i < addDialogInfo.Targets.Count; i++)
                {
                    if (!actorUids.Contains(addDialogInfo.Targets[i].Uid))
                    {
                        actorUids.Add(addDialogInfo.Targets[i].Uid);
                    }
                }
            }

            List <int> actorIds = CollectDialogActorIds(dialogModel);

            for (int i = 0; i < actorIds.Count; i++)
            {
                List <ActorObj> actors = MapLocate.Map.GetActors(actorIds[i]);
                for (int j = 0; j < actors.Count; j++)
                {
                    if (!actorUids.Contains(actors[j].Uid))
                    {
                        actorUids.Add(actors[j].Uid);
                    }
                }
            }

            return(actorUids);
        }
Esempio n. 2
0
 public DialogObj(string uid, DialogType dialogType, int dialogId, int dialogStep, DialogModel model)
 {
     this.Uid        = uid;
     this.DialogType = dialogType;
     this.DialogId   = dialogId;
     this.CurrStep   = dialogStep;
     this.Model      = model;
 }
Esempio n. 3
0
        public bool GetDialogModel(DialogType dialogType, int dialogId, out DialogModel model)
        {
            TBDialogCnf cnf = configDict[dialogType];

            foreach (var item in cnf)
            {
                if (item.Value.id == dialogId)
                {
                    model = item.Value;
                    return(true);
                }
            }
            DialogLocate.Log.LogError("获得对话配置失败>>>>", dialogId);
            model = default;
            return(false);
        }
Esempio n. 4
0
 public bool GetDialogStepModel(DialogModel model, int step, out DialogStepModel stepModel)
 {
     stepModel = default;
     if (model.steps == null || model.steps.Count <= 0)
     {
         DialogLocate.Log.LogError("获得对话步骤配置失败>>>>", model.id);
         return(false);
     }
     for (int i = 0; i < model.steps.Count; i++)
     {
         if (model.steps[i].step == step)
         {
             stepModel = model.steps[i];
             return(true);
         }
     }
     return(false);
 }
Esempio n. 5
0
        /// <summary>
        /// 收集对话配置的演员Id
        /// </summary>
        /// <returns></returns>
        private List <int> CollectDialogActorIds(DialogModel dialogModel)
        {
            List <int> actors = new List <int>();

            if (dialogModel.steps == null || dialogModel.steps.Count <= 0)
            {
                return(actors);
            }
            for (int i = 0; i < dialogModel.steps.Count; i++)
            {
                DialogStepModel stepModel = dialogModel.steps[i];
                if (stepModel.speakers != null && stepModel.speakers.Count > 0)
                {
                    for (int j = 0; j < stepModel.speakers.Count; j++)
                    {
                        if (!actors.Contains(stepModel.speakers[j]))
                        {
                            actors.Add(stepModel.speakers[j]);
                        }
                    }
                }
            }
            return(actors);
        }