Пример #1
0
 public void DispatchEventBelongChange(Belong belong)
 {
     if (BelongChangeHandler != null)
     {
         BelongChangeHandler(belong);
     }
 }
Пример #2
0
 public void DispatchEventMovingTiles(List <VTile> tiles, Belong belong)
 {
     if (MovingTilesHandler != null)
     {
         MovingTilesHandler(tiles, belong);
     }
 }
Пример #3
0
 public void DispatchEventAttackTiles(List <VTile> tiles, Belong belong)
 {
     if (AttackTilesHandler != null)
     {
         AttackTilesHandler(tiles, belong);
     }
 }
Пример #4
0
        public JsonResult Edit(Belong model)
        {
            try
            {
                if (model.BelongId > 0)
                {
                    var entity = _BelongService.GetById(model.BelongId);
                    //修改
                    entity.BelongId = model.BelongId;
                    entity.Title    = model.Title;
                    entity.UTime    = DateTime.Now;
                    entity.Sort     = model.Sort;
                    _BelongService.Update(entity);
                }
                else
                {
                    if (_BelongService.IsExistName(model.Title))
                    {
                        return(Json(new { Status = Successed.Repeat }, JsonRequestBehavior.AllowGet));
                    }
                    //添加
                    model.CTime = DateTime.Now;
                    model.UTime = DateTime.Now;

                    _BelongService.Insert(model);
                }
                return(Json(new { Status = Successed.Ok }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new { Status = Successed.Error }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #5
0
        /// <summary>
        /// 动作结束后处理
        /// </summary>
        public IEnumerator ActionOverNext()
        {
            if (cBattlefield.battleMode == CBattlefield.BattleMode.moving)
            {
                this.mCharacter.Action = ActionType.idle;
            }
            yield return(cBattlefield.StartCoroutine(ActionEndSkillsRun()));

            this.mCharacter.ActionOver = true;
            this.mCharacter.roadLength = 0;
            cBattlefield.tilesManager.ClearCurrentTiles();
            cBattlefield.HideBattleCharacterPreviewDialog();
            cBattlefield.battleMode = CBattlefield.BattleMode.none;
            Belong belong = this.mCharacter.Belong;

            this.mCharacter = null;
            if (!System.Array.Exists(mBaseMap.Characters, c => c.Hp > 0 && !c.IsHide && c.Belong == belong && !c.ActionOver))
            {
                ChangeBelong(belong);
            }
            else
            {
                cBattlefield.CloseOperatingMenu();
            }
        }
Пример #6
0
        /// <summary>
        /// 动作结束后处理
        /// </summary>
        public IEnumerator ActionOverNext()
        {
            if (battleMode == BattleMode.moving)
            {
                currentVCharacter.action = ActionType.idle;
            }
            yield return(AppManager.CurrentScene.StartCoroutine(ActionEndSkillsRun()));

            currentVCharacter.actionOver = true;
            currentMCharacter.roadLength = 0;
            tilesManager.ClearCurrentTiles();
            Global.battleEvent.DispatchEventCharacterPreview(null);
            battleMode = BattleMode.none;
            Belong belong = currentMCharacter.belong;

            this.currentMCharacter = null;
            this.currentVCharacter = null;
            if (!Global.charactersManager.mCharacters.Exists(c => c.hp > 0 && !c.isHide && c.belong == belong && !c.actionOver))
            {
                ChangeBelong(belong);
            }
            else
            {
                Global.battleEvent.DispatchEventOperatingMenu(false);
            }
        }
Пример #7
0
 public bool IsSameBelong(Belong belong1, Belong belong2)
 {
     if (belong1 == Belong.enemy)
     {
         return(belong2 == Belong.enemy);
     }
     return(belong2 == Belong.self || belong2 == Belong.friend);
 }
Пример #8
0
 public void ChangeBelong()
 {
     Player.number += number + 1;
     number         = 0;
     number_str     = number.ToString();
     belong         = Belong.Own;
     this.gameObject.GetComponent <Image>().color = Color.gray;
     Text.GetComponent <Text>().text = number_str;
 }
Пример #9
0
 /// <summary>
 /// 反向
 /// </summary>
 public static Belong opposite(Belong belong)
 {
     if (belong == Belong.Player)
     {
         return(Belong.Enemy);
     }
     if (belong == Belong.Enemy)
     {
         return(Belong.Player);
     }
     return(belong);
 }
Пример #10
0
        public void BoutWave(Belong belong)
        {
            currentBelong = belong;
            if (belong == Belong.self)
            {
                boutCount++;
            }
            charactersManager.ActionRestore();
            System.Action closeEvent = () => {
                this.StartCoroutine(OnBoutStart());
            };
            foreach (MCharacter mCharacter in mBaseMap.Characters)
            {
                mCharacter.boutEventComplete = false;
            }
            Request req = Request.Create("belong", belong, "bout", boutCount, "maxBout", maxBout, "closeEvent", closeEvent);

            this.StartCoroutine(Global.SceneManager.ShowDialog(SceneManager.Prefabs.BoutWaveDialog, req));
        }
Пример #11
0
        private void BoutWave(Belong belong)
        {
            Debug.LogError("BoutWave belong=" + belong);
            Global.battleManager.currentBelong = belong;
            if (belong == Belong.self)
            {
                boutCount++;
            }
            Global.charactersManager.ActionRestore();
            System.Action closeEvent = () => {
                this.StartCoroutine(Global.battleEvent.OnBoutStart());
            };
            foreach (MCharacter mCharacter in Global.charactersManager.mCharacters)
            {
                mCharacter.boutEventComplete = false;
            }
            Request req = Request.Create("belong", belong, "bout", boutCount, "maxBout", maxBout, "closeEvent", closeEvent);

            this.StartCoroutine(Global.AppManager.ShowDialog(Util.Dialog.BoutWaveDialog, req));
        }
Пример #12
0
        public System.Collections.IEnumerator OnBoutStart()
        {
            UnityEngine.Debug.LogError("OnBoutStart");
            Manager.BattleCharactersManager charactersManager = Global.charactersManager;
            Belong currentBelong = Global.battleManager.currentBelong;

            while (true)
            {
                MCharacter mCharacter = charactersManager.mCharacters.Find((c) => {
                    return(c.belong == currentBelong && c.hp > 0 && !c.isHide && !c.boutEventComplete);
                });
                if (mCharacter == null)
                {
                    break;
                }
                Model.Master.MSkill skill = mCharacter.boutFixedDamageSkill;
                if (skill != null)
                {
                    List <VCharacterBase> characters = charactersManager.vCharacters.FindAll((c) => {
                        return(c.hp > 0 && !c.isHide && !charactersManager.IsSameBelong(c.belong, currentBelong));
                    });
                    yield return(OnBoutFixedDamage(mCharacter, skill, characters));
                }
                mCharacter.boutEventComplete = true;
            }
            UnityEngine.Debug.LogError("OnBoutStart currentBelong=" + currentBelong);
            if (currentBelong != Belong.self)
            {
                Global.battleManager.aiManager.Execute(currentBelong);
            }
            else
            {
                Global.battleEvent.DispatchEventOperatingMenu(false);

                /*if (scriptWaitPaths != null)
                 * {
                 *  WaitScript(scriptWaitPaths);
                 * }*/
            }
        }
Пример #13
0
 public void ChangeBelong(Belong belong)
 {
     if (belong == Belong.self)
     {
         if (System.Array.Exists(mBaseMap.Characters, c => c.Hp > 0 && !c.IsHide && c.Belong == Belong.friend && !c.ActionOver))
         {
             cBattlefield.BoutWave(Belong.friend);
         }
         else
         {
             cBattlefield.BoutWave(Belong.enemy);
         }
     }
     else if (belong == Belong.friend)
     {
         cBattlefield.BoutWave(Belong.enemy);
     }
     else if (belong == Belong.enemy)
     {
         cBattlefield.BoutWave(Belong.self);
     }
 }
Пример #14
0
 public void ChangeBelong(Belong belong)
 {
     if (belong == Belong.self)
     {
         if (Global.charactersManager.mCharacters.Exists(c => c.hp > 0 && !c.isHide && c.belong == Belong.friend && !c.actionOver))
         {
             Global.battleEvent.DispatchEventBelongChange(Belong.friend);
         }
         else
         {
             Global.battleEvent.DispatchEventBelongChange(Belong.enemy);
         }
     }
     else if (belong == Belong.friend)
     {
         Global.battleEvent.DispatchEventBelongChange(Belong.enemy);
     }
     else if (belong == Belong.enemy)
     {
         Global.battleEvent.DispatchEventBelongChange(Belong.self);
     }
 }
Пример #15
0
 public void Execute(Belong belong)
 {
     this.belong = belong;
     cBattlefield.StartCoroutine(Execute());
 }
Пример #16
0
 /// <summary>
 /// 删除实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Delete(Belong model)
 {
     this._repoBelong.Delete(model);
 }
Пример #17
0
 /// <summary>
 /// 修改实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Update(Belong model)
 {
     this._repoBelong.Update(model);
 }
Пример #18
0
 /// <summary>
 /// 添加实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Belong Insert(Belong model)
 {
     return(this._repoBelong.Insert(model));
 }
Пример #19
0
 /// <summary>
 /// 修改实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Update(Belong model)
 {
     this._BelongBiz.Update(model);
 }
Пример #20
0
 /// <summary>
 /// 删除实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Delete(Belong model)
 {
     this._BelongBiz.Delete(model);
 }
Пример #21
0
 public Grid(Belong belong)
 {
     setup(belong);
 }
Пример #22
0
 /// <summary>
 /// 改变方块归属
 /// </summary>
 /// <param name="type"></param>
 public void changeBelong(Belong belong)
 {
     this.belong     = belong;
     _refreshRequest = true;
 }
Пример #23
0
 void setup(Belong belong)
 {
     this.belong = belong;
 }
Пример #24
0
 public void Execute(Belong belong)
 {
     this.belong = belong;
     AppManager.CurrentScene.StartCoroutine(Execute());
 }
Пример #25
0
 /// <summary>
 /// 添加实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Belong Insert(Belong model)
 {
     return(this._BelongBiz.Insert(model));
 }