-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGranger.java
More file actions
32 lines (30 loc) · 1.1 KB
/
Granger.java
File metadata and controls
32 lines (30 loc) · 1.1 KB
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
public class Granger implements MagicWand{
private int housePoints = 0;
public Granger(int year){
schoolYear = year;
}
public void expectoPatronum(){
System.out.println("A whisp of fog like smoke erupts from the wand.");
System.out.println( "\"More practice is needed, lose 5 points.\"");
changeHousePoints(-5);
}
public void wingardiumLeviosa(){
System.out.println("\"It's Leviosa, Not Leviosaaa!\"");
System.out.println("A feather gracefully levitates in the air.");
System.out.println("\"Granger earns 10 points\"");
changeHousePoints(10);
}
public void protego(){
System.out.println("An invisible forcefield appears");
System.out.println("\"Granger earns 5 points\"");
changeHousePoints(5);
}
public void expelliarmus(){
System.out.println("Your partner's wand flies out of their hang, into yours.");
System.out.println( "\"Great job Granger! Earn 5 points.\"");
changeHousePoints(5);
}
private void changeHousePoints(int num){
housePoints += num;
}
}