Skip to content

Commit

Permalink
never give up like L.F.C.
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadZafarani committed May 8, 2019
1 parent fe63213 commit 51e50db
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
13 changes: 4 additions & 9 deletions src/controller/AccountController.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void main(Account account) {
isFinish = true;
break;
case SAVE:
save();
isFinish = true;
}
}
while (!isFinish);
Expand All @@ -65,16 +65,11 @@ private void chooseGameKind(AccountRequest request) {
request.getNewCommand();
if (request.getType().equals(RequestType.STORY_GAME)) {
int level = chooseStoryGame(request);

}
if (request.getType().equals(RequestType.CUSTOM_GAME)) {
/*custom game menu*/
}
} while (!request.getType().equals(RequestType.EXIT));

}

private void save() {
}

private void help() {
Expand All @@ -95,10 +90,10 @@ private void enterBattle(AccountRequest request) {
request.getNewCommand();
if (request.getType().equals(RequestType.MULTI_PLAYER)) {
chooseSecondPlayer(request);
}
if (request.getType().equals(RequestType.SINGLE_PLAYER)) {
} else if (request.getType().equals(RequestType.SINGLE_PLAYER)) {
chooseGameKind(request);
}
} else if (request.getType().equals(RequestType.HELP))
view.sout("select \n multiPlayer \n or\nsinglePlayer");
} while (!request.getType().equals(RequestType.EXIT));
}

Expand Down
3 changes: 1 addition & 2 deletions src/controller/CollectionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void main(Collection collection) {
search(request);
break;
case SAVE:

isFinish = true;
break;
case CREATE_DECK:
createDeck(request);
Expand Down Expand Up @@ -104,7 +104,6 @@ private void addCardToDeck(CollectionRequest request) {
int cardID = request.getCardID();
String deckName = request.getDeckName();
Deck deck = collection.getDeck(deckName);

if (collection.getCard(cardID) == null) {
view.printError(ErrorType.CARD_NOT_FOUND_IN_COLLECTION);
return;
Expand Down
1 change: 0 additions & 1 deletion src/controller/GameController.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public void main() {
break;
case EXIT:
isFinish = true;
break;
}
}
while (!isFinish);
Expand Down
4 changes: 2 additions & 2 deletions src/controller/ShopController.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ private void showShopCards() {
private void sellCard(ShopRequest request) {
int cardID = request.getCardID();
boolean isDone = shop.sell(cardID);
if
(isDone) view.successfulSellMessage();
if (isDone)
view.successfulSellMessage();
else
view.unSuccessfulSellMessage();
}
Expand Down
5 changes: 2 additions & 3 deletions src/models/Deck.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import java.util.ArrayList;

public class Deck {
public static final int maxCardNumber = 20;
private static final int maxCardNumber = 20;
private Item item;
private Hero hero;
private ArrayList<Card> cards = new ArrayList<>();
private String name;


Deck(String deckName) {
this.name = deckName;
}
Expand Down Expand Up @@ -43,7 +42,7 @@ public void setName(String name) {
}

boolean isFull() {
return cards.size() == 20;
return cards.size() == maxCardNumber;
}

boolean isSpecifiedHero() {
Expand Down
2 changes: 1 addition & 1 deletion src/models/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Shop {
private Shop() {
}

{ //alrz1999 json
{
Gson gson = new Gson();
JsonReader reader = null;
try {
Expand Down

0 comments on commit 51e50db

Please sign in to comment.