private void OnChessExchange(object content) { if (App.Package.ChessGame.CanDragChess) { Intent intent = (Intent)content; UIWChessHeroItem moveUI = (UIWChessHeroItem)intent.Value("move"); UIWChessHeroItem placeUI = (UIWChessHeroItem)intent.Value("place"); ChessHeroData move = App.Package.ChessGame.GetChessHeroDataById(moveUI.chessId); ChessHeroData place = App.Package.ChessGame.GetChessHeroDataById(placeUI.chessId); if (move.group == ChessHeroGroup.Myself && place.group == ChessHeroGroup.Myself) //只有自己的才可以拖拽 { if (move.heroTypeId == 1 && ChessAgainst.IsFirstRow(place.point)) { Common.UI.OpenTips("炸弹不可以放第一排哦!"); return; } if ((move.heroTypeId == 11 && !ChessAgainst.IsStronghold(place.point)) || (place.heroTypeId == 11 && !ChessAgainst.IsStronghold(move.point))) { Common.UI.OpenTips("军旗只能在大本营中哦!"); return; } if ((move.heroTypeId == 0 && !ChessAgainst.IsAfterCamp(place.point)) || (place.heroTypeId == 0 && !ChessAgainst.IsAfterCamp(move.point))) { Common.UI.OpenTips("地雷只能在后2排哦!"); return; } ChessPoint tpoint = move.point; ChessMoveTo(move, place.point); ChessMoveTo(place, tpoint); } else { Common.UI.OpenTips("不能互换敌方棋子"); } } else { if (App.Package.ChessGame.IsReadyGame && !App.Package.ChessGame.IsGameStart) { Common.UI.OpenTips("已经准备就绪,无法调整棋子"); } } }