I need to register the following event in my program:
- Players who kill 5 times during the 1 minute interval will win a prize.
My class mapping is as follows:
public class Game {
private String name;
private HashMap<String,Player> players;
private Player serialKiller;
private Integer streak;
}
public class Player implements Comparable<Player> {
private String name;
private List<Murder> murderList = new ArrayList<Murder>();
private List<Death> deathList = new ArrayList<Death>();
}
public class Murder {
private Date date;
}
Log file:
07/30/2013 15:34:22 - New match 11348965 has started
30/07/2013 15:36:04 - Roman killed Nick using M16
30/07/2013 15:36:05 - Roman killed mane using M16
30/07/2013 15:36:06 - Roman killed jose using M16
30/07/2013 15:36:07 - Roman killed trevis using M16
30/07/2013 15:36:08 - Roman killed santana using M16
07/30/2013 15:36:05 - noob1 killed noob2 using M16
07/30/2013 15:36:06 - noob1 killed noob3 using M16
07/30/2013 15:36:07 - noob1 killed noob4 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
07/30/2013 15:36:07 - noob10 killed noob1 using M16
30/07/2013 15:36:33 - killed Nick by DROWN
07/30/2013 15:39:22 - Match 11348965 has ended
% time of opponents' death is defined in the user class by the Murder class list.
How can I find out if the player will win the prize without using Threads?