Closed Stadler76 closed 6 years ago
Why not create a function setFirstCockNotOfType(notThisType, setToType)
with a Boolean return to indicate if a update was performed or not.
Or return the Type replaced (Using Undefined
or a new type None
(Null object) if nothing was replaced)
@brrritssocold: Did you mean this?
PS: If you want to, you could write a unit test, that checks, if Pig Truffle and Boar Truffle doesn't fail for players with multi cocks. I'm not in the mood to write tests for issues that may or may not fail due to randomness. You probably have to run 10 x 10 tests or so (10x set two or more cocks to non pig cocks and then eat 10 truffles) and check if none of them errors.
... and added
findFirstCockNotOfType
for a bit more DRY-coding