Created
August 1, 2020 20:33
-
-
Save satan87/608468889d21c70cc656fc584af80c6b to your computer and use it in GitHub Desktop.
This file contains 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
func play() { | |
// We Check we are in Phase One | |
if phase == Phase.phase1 { | |
// We need to clean the result from previous turn | |
emptyTurnCombinationIfNecessary() | |
//We get a new random combination | |
var dice = Dice() | |
dice.roll() | |
let valueOne = dice.value | |
dice.roll() | |
let valueTwo = dice.value | |
dice.roll() | |
let valueThree = dice.value | |
let combination = Combination(one: valueOne, two: valueTwo, three: valueThree) // <- The part causing the problem. | |
lastlaunch = combination | |
turnCombination.append(combination) | |
changePlayer() | |
if turnCombination.count == numberOfPlayer { | |
endTurn() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment