-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from grecodavide/development
Merge Development for lab #2
- Loading branch information
Showing
38 changed files
with
1,145 additions
and
55 deletions.
There are no files selected for viewing
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
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
Binary file not shown.
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
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/main/java/it/polimi/ingsw/gamemodel/AfterDrawState.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package it.polimi.ingsw.gamemodel; | ||
|
||
public class AfterDrawState extends MatchState { | ||
|
||
public AfterDrawState(Match match) { | ||
super(match); | ||
} | ||
|
||
@Override | ||
public void transition() { | ||
MatchState nextState; | ||
|
||
if(match.isFinished()) | ||
nextState = new FinalState(match); | ||
else | ||
nextState = new NextTurnState(match); | ||
|
||
match.setState(nextState); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/it/polimi/ingsw/gamemodel/AfterMoveState.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package it.polimi.ingsw.gamemodel; | ||
|
||
public class AfterMoveState extends MatchState { | ||
|
||
public AfterMoveState(Match match) { | ||
super(match); | ||
} | ||
|
||
@Override | ||
public void drawCard() throws WrongStateException { | ||
this.transition(); | ||
} | ||
|
||
@Override | ||
public void transition() { | ||
MatchState nextState = new AfterDrawState(match); | ||
match.setState(nextState); | ||
} | ||
} |
Oops, something went wrong.