Esempio n. 1
0
        private void EnterSelectMove(BaseSam movingUnit)
        {
            var adapter = new TileAdapter();

            savedPath = adapter.GetPathMove(movingUnit.X, movingUnit.Y, movingUnit.Mov, (byte)ConfigDatas.CampConfig.Indexer.Reborn);
            stage     = ControlStage.SelectMove;
            refreshAll.Fire();
        }
Esempio n. 2
0
        private void BattleMenu_OnClick(string evt)
        {
            var movingUnit = battleManager.GetSam(moveId);

            if (evt == "attack")
            {
                stage = ControlStage.AttackSelect;

                attackId = moveId;
                moveId   = 0;

                var adapter = new TileAdapter();
                savedPath = adapter.GetPathAttack(movingUnit.X, movingUnit.Y, movingUnit.Range, (byte)ConfigDatas.CampConfig.Indexer.Reborn);
            }
            else if (evt == "stop")
            {
                attackId  = 0;
                savedPath = null;
                stage     = ControlStage.None;
                DoStop(moveId);
            }
            else if (evt == "cancel")
            {
                if (movingUnit.X != (byte)savedMovePos.X || movingUnit.Y != (byte)savedMovePos.Y)
                {
                    tileManager.Move(movingUnit.X, movingUnit.Y, (byte)savedMovePos.X, (byte)savedMovePos.Y, moveId, movingUnit.Camp);   //退回

                    movingUnit.X = (byte)savedMovePos.X;
                    movingUnit.Y = (byte)savedMovePos.Y;
                }

                EnterSelectMove(movingUnit);
            }
            refreshAll.Fire();
            battleMenu.Clear();
        }