/// <summary> /// Sets the current start square as clicked /// </summary> /// <param name="view">Start Square</param> public void SetStart(SquareView view) { if (view.Team == currentPlayer.Team) { if (currentPlayer.IsHuman && currentRoll != null && IsAllowedToMoveMarbles()) { if (currentDrag == null) { Vector2 pos = view.GetPosition(); view.HasMarble = false; currentDrag = new MarbleView(this, view, currentPlayer.Team, pos); currentDrag.StartDrag(); } } } }
/// <summary> /// Sets the current start square as clicked /// </summary> /// <param name="view">Start Square</param> public void SetStart(BoardSquareView view) { if (currentPlayer.IsHuman && currentRoll != null && IsAllowedToMoveMarbles()) { Square sq = view.Square; if (!IsPartOfMove(sq)) { if (currentDrag == null && board.Get(sq) == currentPlayer.Team) { Vector2?pos = GetVector(sq); if (pos.HasValue) { currentDrag = new MarbleView(this, sq, currentPlayer.Team, pos.Value); currentDrag.StartDrag(); } } } } }