Coverage Summary for Class: Quest (com.mygdx.game.Quests)
Class |
Class, %
|
Method, %
|
Line, %
|
Quest |
100%
(1/1)
|
66.7%
(4/6)
|
81.8%
(9/11)
|
1 package com.mygdx.game.Quests;
2
3 import com.mygdx.game.Entitys.Player;
4
5 /**
6 * Base class for all quests facilitates the checking of completion
7 */
8 public abstract class Quest {
9 protected String name;
10 protected String description;
11 protected int plunderReward;
12 protected int pointReward;
13 protected boolean isCompleted;
14
15 /**
16 * Constructs a quest with base values filled in
17 */
18 public Quest() {
19 name = "";
20 description = "";
21 plunderReward = 0;
22 pointReward = 0;
23 isCompleted = false;
24 }
25
26 /**
27 * Checks if the given player has met the complete condition
28 * @param p the player
29 * @return has completed
30 */
31 public abstract boolean checkCompleted(Player p);
32
33 /**
34 * @return The plunder reward for this quest
35 */
36 public int getPlunderReward() {
37 return plunderReward;
38 }
39
40 /**
41 * @return The point reward for this quest
42 */
43 public int getPointReward() {
44 return pointReward;
45 }
46
47 /**
48 * @return The completion status of the current quest
49 */
50 public boolean isCompleted() {
51 return isCompleted;
52 }
53
54 /**
55 * @return The name of this quest
56 */
57 public String getName() {
58 return name;
59 }
60
61 /**
62 * @return The description of this quest
63 */
64 public String getDescription() {
65 return description;
66 }
67 }