Beispiel #1
0
        public void SummonToLocation(ChessboardCell cbCell)
        {
            if (Unit_Summoning != null)
            {
                Unit_Summoning(this);
            }

            bool result = cbCell.PlaceUnit(this);
            if (!result)
            {
                throw new Exception("Summon failed. Location is not avaliable for this unit.");
            }

            if (Unit_Summoned != null)
            {
                Unit_Summoned(this);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 移动到某个位置,不能移动返回假
        /// </summary>
        /// <param name="region"></param>
        /// <returns></returns>
        public bool MoveTo(ChessboardCell region)
        {
            if (CanMove(region) == false)
            {
                return false;
            }

            if (ActionState.IsAction == false)//如果没有激活,自动激活
            {
                if (Activate() == false)
                {
                    return false;
                }
            }

            Owner.bDot--;
            return region.PlaceUnit(this);
        }