Skip to content

Conversation

@KKSmith125
Copy link
Owner

No description provided.

this.count += count;
System.out.println("The gumball machine was just refilled; its new count is: " + this.count);
if (currentState == soldOutState) {
currentState = noQuarterState;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AM-1(F): This should be calling the setState method.

//State Interface
//Should showcase actions on the state only
public interface GumballMachineState {
void insertQuarter();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AM-2(F): These should be public

return winnerState;
}

public void refill(int count) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AM-3(F): (No points removed): This is technically a change in state therefore the states should implement this method, but it breaks SOLID, since we are forcing the concretes to implement something they often cant define. There is no good answer, I just wanted to point it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants