Created
October 27, 2017 17:29
-
-
Save backnotprop/949d13cd053002c8c886d2e3b068645a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sender has accepted sent, receiver has accepted received | |
function acceptOffer(sender,receiver, receiverRank, senderRank) { | |
sender.hasAcceptedSentProposal = true; | |
sender.acceptedSentRank = receiverRank; | |
sender.acceptedSentID = receiver.id; | |
receiver.hasAcceptedReceivedProposal = true; | |
receiver.acceptedReceivedRank = senderRank; | |
receiver.acceptedReceivedID = sender.id; | |
} | |
// sender is denied proposal | |
function rejectOffer(sender,receiver) { | |
sender.hasAcceptedSentProposal = false; | |
sender.acceptedSentRank = -1; | |
sender.acceptedSentID = -1; | |
eliminateChoices(receiver,sender); | |
// the function now reruns until sender can send a successful proposal | |
_proposalStage(sender.id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment