renamed VictoryConditions -> ConquestVictoryConditions in prep for adding a custom map
This commit is contained in:
@@ -22,23 +22,21 @@ using System.Linq;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
class VictoryConditionsInfo : ITraitInfo
|
||||
class ConquestVictoryConditionsInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new VictoryConditions( self ); }
|
||||
public object Create(Actor self) { return new ConquestVictoryConditions( self ); }
|
||||
}
|
||||
|
||||
interface IVictoryConditions { bool HasLost { get; } bool HasWon { get; } }
|
||||
|
||||
class VictoryConditions : ITick, IVictoryConditions, IResolveOrder
|
||||
class ConquestVictoryConditions : ITick, IVictoryConditions, IResolveOrder
|
||||
{
|
||||
public bool HasLost { get; private set; }
|
||||
public bool HasWon { get; private set; }
|
||||
|
||||
public VictoryConditions(Actor self) { }
|
||||
public ConquestVictoryConditions(Actor self) { }
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var info = self.Info.Traits.Get<VictoryConditionsInfo>();
|
||||
var info = self.Info.Traits.Get<ConquestVictoryConditionsInfo>();
|
||||
var hasAnything = self.World.Queries.OwnedBy[self.Owner]
|
||||
.WithTrait<MustBeDestroyed>().Any();
|
||||
|
||||
@@ -134,4 +134,6 @@ namespace OpenRA.Traits
|
||||
|
||||
public interface IRenderOverlay { void Render(); }
|
||||
public interface INotifyIdle { void Idle(Actor self); }
|
||||
|
||||
public interface IVictoryConditions { bool HasLost { get; } bool HasWon { get; } }
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace OpenRA.Widgets
|
||||
|
||||
bool AreMutualAllies(Player a, Player b) { return a.Stances[b] == Stance.Ally && b.Stances[a] == Stance.Ally; }
|
||||
|
||||
// todo: all this shit needs to move, probably to Player.
|
||||
|
||||
public override void Draw(World world)
|
||||
{
|
||||
base.Draw(world);
|
||||
|
||||
Reference in New Issue
Block a user