Require explicit implementation of INotifyObjectivesUpdated
This commit is contained in:
committed by
Paul Chote
parent
d10d48c25f
commit
e71a31925f
@@ -175,7 +175,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
OnProducedInternal(self, other);
|
OnProducedInternal(self, other);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerWon(Player player)
|
void INotifyObjectivesUpdated.OnPlayerWon(Player player)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
@@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerLost(Player player)
|
void INotifyObjectivesUpdated.OnPlayerLost(Player player)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
@@ -215,7 +215,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnObjectiveAdded(Player player, int id)
|
void INotifyObjectivesUpdated.OnObjectiveAdded(Player player, int id)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
@@ -236,7 +236,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnObjectiveCompleted(Player player, int id)
|
void INotifyObjectivesUpdated.OnObjectiveCompleted(Player player, int id)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
@@ -257,7 +257,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnObjectiveFailed(Player player, int id)
|
void INotifyObjectivesUpdated.OnObjectiveFailed(Player player, int id)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
mo.MarkCompleted(self.Owner, objectiveID);
|
mo.MarkCompleted(self.Owner, objectiveID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerLost(Player player)
|
void INotifyObjectivesUpdated.OnPlayerLost(Player player)
|
||||||
{
|
{
|
||||||
foreach (var a in player.World.ActorsWithTrait<INotifyOwnerLost>().Where(a => a.Actor.Owner == player))
|
foreach (var a in player.World.ActorsWithTrait<INotifyOwnerLost>().Where(a => a.Actor.Owner == player))
|
||||||
a.Trait.OnOwnerLost(a.Actor);
|
a.Trait.OnOwnerLost(a.Actor);
|
||||||
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerWon(Player player)
|
void INotifyObjectivesUpdated.OnPlayerWon(Player player)
|
||||||
{
|
{
|
||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
@@ -97,8 +97,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnObjectiveAdded(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveAdded(Player player, int id) { }
|
||||||
public void OnObjectiveCompleted(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveCompleted(Player player, int id) { }
|
||||||
public void OnObjectiveFailed(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveFailed(Player player, int id) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerWon(Player player)
|
void INotifyObjectivesUpdated.OnPlayerWon(Player player)
|
||||||
{
|
{
|
||||||
var players = player.World.Players.Where(p => !p.NonCombatant);
|
var players = player.World.Players.Where(p => !p.NonCombatant);
|
||||||
var enemies = players.Where(p => !p.IsAlliedWith(player));
|
var enemies = players.Where(p => !p.IsAlliedWith(player));
|
||||||
@@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
CheckIfGameIsOver(player);
|
CheckIfGameIsOver(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerLost(Player player)
|
void INotifyObjectivesUpdated.OnPlayerLost(Player player)
|
||||||
{
|
{
|
||||||
var players = player.World.Players.Where(p => !p.NonCombatant);
|
var players = player.World.Players.Where(p => !p.NonCombatant);
|
||||||
var enemies = players.Where(p => !p.IsAlliedWith(player));
|
var enemies = players.Where(p => !p.IsAlliedWith(player));
|
||||||
@@ -259,9 +259,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public event Action<Player, bool> ObjectiveAdded = (player, inhibitAnnouncement) => { player.HasObjectives = true; };
|
public event Action<Player, bool> ObjectiveAdded = (player, inhibitAnnouncement) => { player.HasObjectives = true; };
|
||||||
|
|
||||||
public void OnObjectiveAdded(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveAdded(Player player, int id) { }
|
||||||
public void OnObjectiveCompleted(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveCompleted(Player player, int id) { }
|
||||||
public void OnObjectiveFailed(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveFailed(Player player, int id) { }
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerLost(Player player)
|
void INotifyObjectivesUpdated.OnPlayerLost(Player player)
|
||||||
{
|
{
|
||||||
foreach (var a in player.World.ActorsWithTrait<INotifyOwnerLost>().Where(a => a.Actor.Owner == player))
|
foreach (var a in player.World.ActorsWithTrait<INotifyOwnerLost>().Where(a => a.Actor.Owner == player))
|
||||||
a.Trait.OnOwnerLost(a.Actor);
|
a.Trait.OnOwnerLost(a.Actor);
|
||||||
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerWon(Player player)
|
void INotifyObjectivesUpdated.OnPlayerWon(Player player)
|
||||||
{
|
{
|
||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
@@ -136,8 +136,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnObjectiveAdded(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveAdded(Player player, int id) { }
|
||||||
public void OnObjectiveCompleted(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveCompleted(Player player, int id) { }
|
||||||
public void OnObjectiveFailed(Player player, int id) { }
|
void INotifyObjectivesUpdated.OnObjectiveFailed(Player player, int id) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,6 +425,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
int ExitDelay { get; }
|
int ExitDelay { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RequireExplicitImplementation]
|
||||||
public interface INotifyObjectivesUpdated
|
public interface INotifyObjectivesUpdated
|
||||||
{
|
{
|
||||||
void OnPlayerWon(Player winner);
|
void OnPlayerWon(Player winner);
|
||||||
|
|||||||
Reference in New Issue
Block a user