Class Design

m

RPS

Constructor

r

need to be able to create our RPS object, the question is when and how?

At the beginning?

r

we haven't done anything yet and it doesn't really know anything eitherDefault constructorAt program/form initialization

Just declare it

r

just a place holder, no data or object yet

when needed

r

1) user has indicated they want to play

user wants to play

user makes a choice

RockPaperScissors(RPSChoice userChoice)

the first time user makes a choice

r

implies user may play rps multiple times and wants to reuse the object

rps.userChoice = userChoice;

gameResult = rps.Play(userChoice, out computerChoice);
computerChoice = rps.computerChoice;

and then what?

get the computer's choice

get the game result