WIP add missions etc.
This commit is contained in:
parent
3ceb4492d1
commit
6f8b981cea
3 changed files with 79 additions and 2 deletions
|
|
@ -6,27 +6,65 @@ public abstract class Goal {
|
|||
private final String description;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* Constructs a new goal/mission
|
||||
* @param name Quick name
|
||||
* @param description Description for the goal
|
||||
*/
|
||||
public Goal(String name, String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current game
|
||||
* @param game The game
|
||||
*/
|
||||
public void setGame(Game game) {
|
||||
this.game = game;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the goal/mission is completed
|
||||
* @return True if the mission is complete, false
|
||||
* otherwise
|
||||
*/
|
||||
public abstract boolean isCompleted();
|
||||
|
||||
/**
|
||||
* Returns the winner of the game or null
|
||||
* if there is no winner (yet)
|
||||
* @return A Player object or null
|
||||
*/
|
||||
public abstract Player getWinner();
|
||||
|
||||
/**
|
||||
* Returns whether a player has lost
|
||||
* @param player The player
|
||||
* @return True if the player has lost
|
||||
*/
|
||||
public abstract boolean hasLost(Player player);
|
||||
|
||||
/**
|
||||
* Gets the description of the mission
|
||||
* @return The description
|
||||
*/
|
||||
public final String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the mission
|
||||
* @return The name
|
||||
*/
|
||||
public final String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the game attached to this mission
|
||||
* @return The game
|
||||
*/
|
||||
protected Game getGame() {
|
||||
return this.game;
|
||||
}
|
||||
|
|
|
|||
31
Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java
Normal file
31
Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package game.goals;
|
||||
|
||||
import game.Goal;
|
||||
import game.Player;
|
||||
|
||||
public class CaptureTheFlagGoal extends Goal {
|
||||
|
||||
public CaptureTheFlagGoal() {
|
||||
// TODO Auto-generated constructor stub
|
||||
super("Capture the flag", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompleted() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Player getWinner() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLost(Player player) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -193,4 +193,12 @@ Für alle abgearbeiteten Knoten gilt:
|
|||
|
||||
\subsection{Kürzester Pfad zu allen Knoten}
|
||||
|
||||
\section{Weitergestaltung des Spiels}
|
||||
|
||||
\subsection{Computergegner}
|
||||
|
||||
\subsection{Missionen}
|
||||
|
||||
\subsection{Joker}
|
||||
|
||||
\end{document}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue