Add support for mission objectives
Objectives can be either primary or secondary objectives. Primary ones influence the outcome of the game. If all primary objectives are completed the game is won, and lost when any of them fails. Objectives can be added at any stage during the game, allowing to react dynamically to game events. The objectives backend only contains the information about the objectives themselves. It does not check if objectives are completed or failed. Instead, the state of objectives must be manually marked. The backend, however, does check whether the game is won or lost.
This commit is contained in:
@@ -42,8 +42,19 @@ namespace OpenRA
|
||||
public void AddPlayer(Player p) { Players.Add(p); }
|
||||
public Player LocalPlayer { get; private set; }
|
||||
|
||||
Player renderPlayer;
|
||||
public event Action GameOver = () => { };
|
||||
bool gameOver;
|
||||
public void EndGame()
|
||||
{
|
||||
if (!gameOver)
|
||||
{
|
||||
gameOver = true;
|
||||
GameOver();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ObserveAfterWinOrLose;
|
||||
Player renderPlayer;
|
||||
public Player RenderPlayer
|
||||
{
|
||||
get { return renderPlayer == null || (ObserveAfterWinOrLose && renderPlayer.WinState != WinState.Undefined) ? null : renderPlayer; }
|
||||
|
||||
Reference in New Issue
Block a user