1
1
package servercontroller ;
2
2
3
- import clientview .MainClient ;
3
+ import clientview .Main ;
4
+ import clientview .MainView ;
4
5
import model .*;
5
6
7
+
6
8
public class GameController {
9
+ int rounds ;
10
+ Player firstWinner ;
11
+ Player secondWinner ;
12
+ Player thirdWinner ;
13
+ int firstLp ;
14
+ int secondLp ;
15
+ int thirdLP ;
7
16
private static GameController duelController = null ;
8
17
public static GameController getInstance () {
9
18
if (duelController == null )
@@ -25,15 +34,15 @@ else if (!((SpellCard) card).getIcon().equals("Ritual") || GlobalVariable.getBoa
25
34
return "you should ritual summon right now" ;
26
35
else {
27
36
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 ();
30
39
if (!isLevelMatched (monster1 , monster2 , card , token ))
31
40
return "selected monsters levels don't match with ritual monster" ;
32
41
else {
33
42
tributeMonsters (Integer .parseInt (monster1 ), token );
34
43
tributeMonsters (Integer .parseInt (monster2 ), token );
35
44
System .out .println ("please enter the attack or defence status" );
36
- String status = MainClient .scanner .nextLine ();
45
+ String status = Main .scanner .nextLine ();
37
46
if (status .equals ("attacking" )) {
38
47
((MonsterCard ) card ).setIsAttack (true );
39
48
card .setSide (false );
@@ -449,7 +458,7 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
449
458
if (countNokhodi (token ) == 5 )
450
459
return "there are not enough cards for tribute" ;
451
460
else {
452
- String s = MainClient .scanner .nextLine ();
461
+ String s = Main .scanner .nextLine ();
453
462
if (s .equals ("cancel" )) {
454
463
deselect (token );
455
464
return "" ;
@@ -547,7 +556,7 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
547
556
getPlayBoardByTurn ().getSelectedCard ().getName ().equals ("BeastKingBarbaros" )) {
548
557
int i ;
549
558
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 ();
551
560
ActionMonster actionMonster = new ActionMonster ();
552
561
if (i == 0 ) {
553
562
actionMonster .setAction (8 , (MonsterCard ) GlobalVariable .getBoards ().get (token ).
@@ -567,8 +576,8 @@ else if (((MonsterCard) GlobalVariable.getBoards().get(token).getPlayBoardByTurn
567
576
if (countNokhodi (token ) > 3 )
568
577
return "there are not enough cards for tribute" ;
569
578
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 ());
572
581
if (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ().getMonsters ().get (monster - 1 ).getName ().equals ("nokhodi" ) ||
573
582
GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ().getMonsters ().get (monster1 - 1 ).getName ().equals ("nokhodi" ))
574
583
return "there no monsters one this address" ;
@@ -940,8 +949,8 @@ public void activateCardAndChangeTurn(Card card, String token) {
940
949
System .out .println ("now it will be " + GlobalVariable .getPlayers ().get (token ).getUsername () + " turn" );
941
950
System .out .println (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ());
942
951
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 ();
945
954
if (input .equals ("no" )) {
946
955
System .out .println ("now it will be " + GlobalVariable .getPlayers ().get (token ).getUsername () + " turn" );
947
956
System .out .println (GlobalVariable .getBoards ().get (token ).getPlayBoardByTurn ());
0 commit comments