Use Action<bool> for objective delegate type

This commit is contained in:
Scott_NZ
2013-02-02 20:44:05 +13:00
parent 7594c4eab2
commit b3fbafad59
6 changed files with 11 additions and 9 deletions

View File

@@ -8,14 +8,15 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Air; using OpenRA.Mods.RA.Air;
using OpenRA.Mods.RA.Move; using OpenRA.Mods.RA.Move;
using OpenRA.Scripting; using OpenRA.Scripting;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Mods.RA.Activities;
namespace OpenRA.Mods.RA.Missions namespace OpenRA.Mods.RA.Missions
{ {
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.RA.Missions
class Allies01Script : IHasObjectives, IWorldLoaded, ITick class Allies01Script : IHasObjectives, IWorldLoaded, ITick
{ {
public event ObjectivesUpdatedEventHandler OnObjectivesUpdated = notify => { }; public event Action<bool> OnObjectivesUpdated = notify => { };
public IEnumerable<Objective> Objectives { get { return objectives.Values; } } public IEnumerable<Objective> Objectives { get { return objectives.Values; } }

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -25,7 +26,7 @@ namespace OpenRA.Mods.RA.Missions
class Allies02Script : IHasObjectives, IWorldLoaded, ITick class Allies02Script : IHasObjectives, IWorldLoaded, ITick
{ {
public event ObjectivesUpdatedEventHandler OnObjectivesUpdated = notify => { }; public event Action<bool> OnObjectivesUpdated = notify => { };
public IEnumerable<Objective> Objectives { get { return objectives.Values; } } public IEnumerable<Objective> Objectives { get { return objectives.Values; } }

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Missions
class Allies03Script : IHasObjectives, IWorldLoaded, ITick class Allies03Script : IHasObjectives, IWorldLoaded, ITick
{ {
public event ObjectivesUpdatedEventHandler OnObjectivesUpdated = notify => { }; public event Action<bool> OnObjectivesUpdated = notify => { };
public IEnumerable<Objective> Objectives { get { return objectives.Values; } } public IEnumerable<Objective> Objectives { get { return objectives.Values; } }

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Missions
class Allies04Script : IHasObjectives, IWorldLoaded, ITick class Allies04Script : IHasObjectives, IWorldLoaded, ITick
{ {
public event ObjectivesUpdatedEventHandler OnObjectivesUpdated = notify => { }; public event Action<bool> OnObjectivesUpdated = notify => { };
public IEnumerable<Objective> Objectives { get { return objectives.Values; } } public IEnumerable<Objective> Objectives { get { return objectives.Values; } }

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using OpenRA.Traits; using OpenRA.Traits;
@@ -30,11 +31,9 @@ namespace OpenRA.Mods.RA.Missions
public enum ObjectiveType { Primary, Secondary } public enum ObjectiveType { Primary, Secondary }
public enum ObjectiveStatus { Inactive, InProgress, Completed, Failed } public enum ObjectiveStatus { Inactive, InProgress, Completed, Failed }
public delegate void ObjectivesUpdatedEventHandler(bool notify);
public interface IHasObjectives public interface IHasObjectives
{ {
event ObjectivesUpdatedEventHandler OnObjectivesUpdated; event Action<bool> OnObjectivesUpdated;
IEnumerable<Objective> Objectives { get; } IEnumerable<Objective> Objectives { get; }
} }

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.RA.Missions
class Soviet01ClassicScript : IHasObjectives, IWorldLoaded, ITick class Soviet01ClassicScript : IHasObjectives, IWorldLoaded, ITick
{ {
public event ObjectivesUpdatedEventHandler OnObjectivesUpdated = notify => { }; public event Action<bool> OnObjectivesUpdated = notify => { };
public IEnumerable<Objective> Objectives { get { return objectives.Values; } } public IEnumerable<Objective> Objectives { get { return objectives.Values; } }