11package servercontroller ;
22
3- import clientview .MainClient ;
3+ import clientview .Main ;
4+ import clientview .MainView ;
45import model .*;
56
7+
68public class GameController {
9+ int rounds ;
10+ Player firstWinner ;
11+ Player secondWinner ;
12+ Player thirdWinner ;
13+ int firstLp ;
14+ int secondLp ;
15+ int thirdLP ;
716 private static GameController duelController = null ;
817 public static GameController getInstance () {
918 if (duelController == null )
@@ -25,15 +34,15 @@ else if (!((SpellCard) card).getIcon().equals("Ritual") || GlobalVariable.getBoa
2534 return "you should ritual summon right now" ;
2635 else {
2736 System .out .println ("please enter the cards(the number of cards) that you want to tribute" );
28- String monster1 = MainClient .scanner .nextLine ();
29- String monster2 = MainClient .scanner .nextLine ();
37+ String monster1 = Main .scanner .nextLine ();
38+ String monster2 = Main .scanner .nextLine ();
3039 if (!isLevelMatched (monster1 , monster2 , card , token ))
3140 return "selected monsters levels don't match with ritual monster" ;
3241 else {
3342 tributeMonsters (Integer .parseInt (monster1 ), token );
3443 tributeMonsters (Integer .parseInt (monster2 ), token );
3544 System .out .println ("please enter the attack or defence status" );
36- String status = MainClient .scanner .nextLine ();
45+ String status = Main .scanner .nextLine ();
3746 if (status .equals ("attacking" )) {
3847 ((MonsterCard ) card ).setIsAttack (true );
3948 card .setSide (false );
@@ -449,7 +458,7 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
449458 if (countNokhodi (token ) == 5 )
450459 return "there are not enough cards for tribute" ;
451460 else {
452- String s = MainClient .scanner .nextLine ();
461+ String s = Main .scanner .nextLine ();
453462 if (s .equals ("cancel" )) {
454463 deselect (token );
455464 return "" ;
@@ -547,7 +556,7 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
547556 getPlayBoardByTurn ().getSelectedCard ().getName ().equals ("BeastKingBarbaros" )) {
548557 int i ;
549558 System .out .println ("please enter which mode you want to sacrifice press 1 else 0" );
550- i = MainClient .scanner .nextInt ();
559+ i = Main .scanner .nextInt ();
551560 ActionMonster actionMonster = new ActionMonster ();
552561 if (i == 0 ) {
553562 actionMonster .setAction (8 , (MonsterCard ) GlobalVariable .getBoards ().get (token ).
@@ -567,8 +576,8 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
567576 if (countNokhodi (token ) > 3 )
568577 return "there are not enough cards for tribute" ;
569578 else {
570- int monster = Integer .parseInt (MainClient .scanner .nextLine ());
571- int monster1 = Integer .parseInt (MainClient .scanner .nextLine ());
579+ int monster = Integer .parseInt (Main .scanner .nextLine ());
580+ int monster1 = Integer .parseInt (Main .scanner .nextLine ());
572581 if (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ().getMonsters ().get (monster - 1 ).getName ().equals ("nokhodi" ) ||
573582 GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ().getMonsters ().get (monster1 - 1 ).getName ().equals ("nokhodi" ))
574583 return "there no monsters one this address" ;
@@ -940,8 +949,8 @@ public void activateCardAndChangeTurn(Card card, String token) {
940949 System .out .println ("now it will be " + GlobalVariable .getPlayers ().get (token ).getUsername () + " turn" );
941950 System .out .println (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ());
942951 System .out .println ("do you want to activate your trap and spell?" );
943- String input = MainClient .scanner .nextLine ();
944- String activation = MainClient .scanner .nextLine ();
952+ String input = Main .scanner .nextLine ();
953+ String activation = Main .scanner .nextLine ();
945954 if (input .equals ("no" )) {
946955 System .out .println ("now it will be " + GlobalVariable .getPlayers ().get (token ).getUsername () + " turn" );
947956 System .out .println (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ());
0 commit comments