forked from aryanch22/PlanetHoppingGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWin.java
More file actions
33 lines (30 loc) · 971 Bytes
/
Win.java
File metadata and controls
33 lines (30 loc) · 971 Bytes
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
import java.util.*;
import java.io.*;
/**
* Write a description of class Win here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Win
{
public boolean WinCondition(String hits, String path) throws Exception{
//if the player hits the monster a certain about of time then he defeats the Monster
//Acts has the win condition true when the player/monster has dealt enought damage to player/monster
//False if not enough
AttackMonster res = new AttackMonster();
File file = new File(path);
BufferedReader br = new BufferedReader(new FileReader(file));
String st;
st = br.readLine();
st = st.trim();
if(hits != "miss"){
System.out.println(hits.length() + " of " + st.length());
}
if(hits.equals(st)){
res.resetCondition();
return true;
}
return false;
}
}