-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAthletesActions.java
51 lines (38 loc) · 1.52 KB
/
AthletesActions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.util.InputMismatchException;
import java.util.Scanner;
public class AthletesActions {
private Athletes athlete;
public AthletesActions(Athletes a) {
athlete = a;
}
public void showProfile() {
System.out.println("Name: " + athlete.getName()+" Age: " +athlete.getAge()+" Sport: "+ athlete.getSport()+ " Position: " +athlete.getPosition()+ " Current Team: " + athlete.getCurrent_team()+
" Height: "+athlete.getHeight()+" Weight: "+ athlete.getWeight()+" Likes: "+ athlete.getLikes()+" Bio: "+athlete.getBio());
}
public void seeWholeConversation(Users receiver) {
Chat.seeConversation(athlete.getMessages(), receiver);
System.out.println("Do you want to send a new message? Type 1 for YES 2 for NO :");
Scanner in = new Scanner(System.in);
boolean continueLoop = true;
int reachout = 0;
do {
try {
reachout = in.nextInt();
while( reachout !=1 && reachout !=2 ) {
System.out.println("Wrong answer.Please type 1 for YES 2 for NO :");
reachout = in.nextInt();
}
continueLoop = false;
} catch(InputMismatchException e) {
System.out.println("You must enter a number. Please type 1 for YES 2 for NO :");
in.nextLine();
}
} while (continueLoop);
if (reachout == 1) {
Chat.sendMessage(receiver,athlete, Chat.checkChat(receiver, athlete));
}
}
public void sendNewMessage(Users receiver) {
Chat.sendMessage(receiver,athlete, Chat.checkChat(receiver, athlete));
}
}