private void button1_Click(object sender, EventArgs e) { //new up MonopolyDealServiceReference.PropertyCard pickedPropertyToMove = listBoxPickProperty.SelectedItem as MonopolyDealServiceReference.PropertyCard; MonopolyDealServiceReference.PropertyCardSet newPropertySet = null; MonopolyDealServiceReference.PropertyCardSet oldPropertySet = listBoxPickOriginalSetToRemoveCardFrom.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; bool isCardUp = true; bool playToExistingSet = false; if (pickedPropertyToMove != null) { if (newPropertySet == null) { if (oldPropertySet != null) { if (request.moveProperty(pickedPropertyToMove.cardID, oldPropertySet.guid, newPropertySet.guid, isCardUp, playToExistingSet)) { MessageBox.Show("Property Moved"); } } else { MessageBox.Show("No old property set picked"); } } else { MessageBox.Show("No new Property set picked"); } } else { MessageBox.Show("No Property picked"); } }
internal bool hotel(MonopolyDealServiceReference.ActionCard Card, MonopolyDealServiceReference.PropertyCardSet targetedSet) { getServiceReady(); try { MonopolyDealServiceReference.BoolResponseBox response; response = monopolyDealService.playHotelMD(Card.cardID, targetedSet.guid.boxGuid(), thisClientGuid.boxGuid(), gameOnServiceGuid.boxGuid(), CurrentPlayFieldModel.thisPlayFieldModelInstanceGuid.boxGuid()); addToLog(response.message); return(response.success); } catch (Exception ex) { addToLog(ex.ToString()); monopolyDealService.Close(); } return(false); }
private void button1_Click(object sender, EventArgs e) { //use rent no double the rent MonopolyDealServiceReference.PropertyCardSet selectedSet = listBoxSet.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; MonopolyDealServiceReference.Card doubleTheRentCard = null; int doubleTheRentCardID = -1; if (doubleTheRentCard != null) { doubleTheRentCardID = doubleTheRentCard.cardID; } bool usingDoubleTheRent = false; bool isWildRentCard = true; if (RentCard is MonopolyDealServiceReference.RentStandard) { isWildRentCard = false; } request.useRentCard(RentCard.cardID, selectedSet.guid, usingDoubleTheRent, doubleTheRentCardID, isWildRentCard, targetedPlayer); }
private void button11_Click(object sender, EventArgs e) { MonopolyDealServiceReference.PropertyCardSet pcs = null; MonopolyDealServiceReference.PropertyCard pc = null; if (playerIDNum == 0) { pc = listBoxPlayer0Hand.SelectedValue as MonopolyDealServiceReference.PropertyCard; pcs = listBoxPSetsP0.SelectedValue as MonopolyDealServiceReference.PropertyCardSet; } else if (playerIDNum == 1) { pc = listBoxPlayer1Hand.SelectedValue as MonopolyDealServiceReference.PropertyCard; pcs = listBoxPSetsP1.SelectedValue as MonopolyDealServiceReference.PropertyCardSet; } else if (playerIDNum == 2) { pc = listBoxPlayer2Hand.SelectedValue as MonopolyDealServiceReference.PropertyCard; pcs = listBoxPSetsP2.SelectedValue as MonopolyDealServiceReference.PropertyCardSet; } else if (playerIDNum == 3) { pc = listBoxPlayer3Hand.SelectedValue as MonopolyDealServiceReference.PropertyCard; pcs = listBoxPSetsP3.SelectedValue as MonopolyDealServiceReference.PropertyCardSet; } else if (playerIDNum == 4) { pc = listBoxPlayer4Hand.SelectedValue as MonopolyDealServiceReference.PropertyCard; pcs = listBoxPSetsP4.SelectedValue as MonopolyDealServiceReference.PropertyCardSet; } if (pc != null && pcs != null) { pc.isCardUp = false; requestHandlerMD.playPropertyToSelectedSet(pc, pcs); } //Update State buttonPollMD_Click(null, null); }
private void buttonRentDouble_Click(object sender, EventArgs e) { MonopolyDealServiceReference.PropertyCardSet selectedSet = listBoxSet.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; MonopolyDealServiceReference.ActionCard doubleTheRentCard = listBoxCardsInHand.SelectedItem as MonopolyDealServiceReference.ActionCard; int doubleTheRentCardID = -1; if (doubleTheRentCard != null && doubleTheRentCard.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.DoubleTheRent) == 0) { doubleTheRentCardID = doubleTheRentCard.cardID; } else { MessageBox.Show("No card Selected or is not a double the rent card"); return; } bool usingDoubleTheRent = true; bool isWildRentCard = true; if (RentCard is MonopolyDealServiceReference.RentStandard) { isWildRentCard = false; } request.useRentCard(RentCard.cardID, selectedSet.guid, usingDoubleTheRent, doubleTheRentCardID, isWildRentCard, targetedPlayer); }
internal void playPropertyToSelectedSet(MonopolyDealServiceReference.PropertyCard pc, MonopolyDealServiceReference.PropertyCardSet pcs) { getServiceReady(); try { if (monopolyDealService.playPropertyCardMD(null, pc, pcs, thisClientGuid.boxGuid(), gameLobbyGuid.boxGuid(), CurrentPlayFieldModel.thisPlayFieldModelInstanceGuid.boxGuid(), null)) { addToLog("Property played to new set"); } else { addToLog("Error, card not played"); } } catch (Exception ex) { addToLog(ex.ToString()); monopolyDealService.Close(); } }
private void buttonUseDealBreaker_Click(object sender, EventArgs e) { if (Card != null) { if (Card.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.DealBreaker) == 0) { //this.Text = "Use DealBreaker Card"; if (listBoxPlayers.SelectedItem != null) { MonopolyDealServiceReference.PlayerModel playerTargeted = (MonopolyDealServiceReference.PlayerModel)listBoxPlayers.SelectedItem; if (playerTargeted.guid.CompareTo(request.thisClientGuid) == 0) { MessageBox.Show("Can not DealBreaker yourself"); return; } else { MonopolyDealServiceReference.PropertyCardSet targetedSet = listBoxSets.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; if (targetedSet != null) { request.dealBreaker(Card, playerTargeted.guid, targetedSet); this.Close(); } else { MessageBox.Show("No set selected"); return; } } } } else if (Card.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.SlyDeal) == 0) { //this.Text = "Use Sly Deal Card"; //buttonUseDealBreaker.Text = "Sly Deal"; //this.Text = "Use DealBreaker Card"; if (listBoxPlayers.SelectedItem != null) { MonopolyDealServiceReference.PlayerModel playerTargeted = (MonopolyDealServiceReference.PlayerModel)listBoxPlayers.SelectedItem; if (playerTargeted.guid.CompareTo(request.thisClientGuid) == 0) { MessageBox.Show("Can not Sly Deal yourself"); return; } else { MonopolyDealServiceReference.PropertyCardSet targetedSet = listBoxSets.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; if (targetedSet != null) { MonopolyDealServiceReference.Card targetedCard = listBoxCardsInSet.SelectedItem as MonopolyDealServiceReference.Card; if (targetedCard != null) { request.slyDeal(Card, playerTargeted.guid, targetedSet, targetedCard); this.Close(); } else { MessageBox.Show("No Card selected"); } } else { MessageBox.Show("No set selected"); return; } } } } else if (Card.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.House) == 0) { //this.Text = "Use House Card"; //buttonUseDealBreaker.Text = "Add House"; if (listBoxPlayers.SelectedItem != null) { MonopolyDealServiceReference.PlayerModel playerTargeted = (MonopolyDealServiceReference.PlayerModel)listBoxPlayers.SelectedItem; if (playerTargeted.guid.CompareTo(request.thisClientGuid) != 0) { MessageBox.Show("Can not add a House to another Players Sets"); return; } else { MonopolyDealServiceReference.PropertyCardSet targetedSet = listBoxSets.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; if (targetedSet != null) { if (targetedSet.hasHouse) { MessageBox.Show("Can not add more than one house to a set"); this.Close(); } else { request.house(Card, targetedSet); this.Close(); } } else { MessageBox.Show("No set selected"); return; } } } } else if (Card.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.Hotel) == 0) { //this.Text = "Use Hotel Card"; //buttonUseDealBreaker.Text = "Add Hotel"; if (listBoxPlayers.SelectedItem != null) { MonopolyDealServiceReference.PlayerModel playerTargeted = (MonopolyDealServiceReference.PlayerModel)listBoxPlayers.SelectedItem; if (playerTargeted.guid.CompareTo(request.thisClientGuid) != 0) { MessageBox.Show("Can not add a Hotel to another Players Sets"); return; } else { MonopolyDealServiceReference.PropertyCardSet targetedSet = listBoxSets.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; if (targetedSet != null) { if (targetedSet.hasHouse != true) { MessageBox.Show("Can not add a Hotel to a set that does not have a House"); this.Close(); } else if (targetedSet.hasHotel) { MessageBox.Show("Can not add more than one Hotel to a Set"); } else { request.hotel(Card, targetedSet); this.Close(); } } else { MessageBox.Show("No set selected"); return; } } } } else if (Card.actionType.CompareTo(MonopolyDealServiceReference.ActionCardAction.ForcedDeal) == 0) { if (listBoxPlayers.SelectedItem != null) { MonopolyDealServiceReference.PlayerModel playerTargeted = (MonopolyDealServiceReference.PlayerModel)listBoxPlayers.SelectedItem; if (playerTargeted.guid.CompareTo(request.thisClientGuid) == 0) { MessageBox.Show("Can not Forced Deal yourself"); return; } else { MonopolyDealServiceReference.PropertyCardSet targetedSet = listBoxSets.SelectedItem as MonopolyDealServiceReference.PropertyCardSet; if (targetedSet != null) { MonopolyDealServiceReference.Card targetedCard = listBoxCardsInSet.SelectedItem as MonopolyDealServiceReference.Card; if (targetedCard != null) { if (listBoxSetCardToGiveUpIsIn.SelectedItem != null) { MonopolyDealServiceReference.PropertyCardSet givenUpCardSet = (MonopolyDealServiceReference.PropertyCardSet)listBoxSetCardToGiveUpIsIn.SelectedItem; if (listBoxCardToGiveUp.SelectedItem != null) { MonopolyDealServiceReference.Card givenUpCard = (MonopolyDealServiceReference.Card)listBoxCardToGiveUp.SelectedItem; request.forcedDeal(Card, playerTargeted.guid, targetedSet, targetedCard, givenUpCardSet, givenUpCard); } else { MessageBox.Show("No Card selected to be given up in Forced Deal"); } } else { MessageBox.Show("No set to give up Card from in Forced Deal selected"); } } else { MessageBox.Show("No Card to take in Forced Deal selected"); } } else { MessageBox.Show("No set to take Card from in Forced Deal selected"); return; } } } } } }