renamed VictoryConditions -> ConquestVictoryConditions in prep for adding a custom map

This commit is contained in:
Chris Forbes
2010-05-06 18:16:36 +12:00
parent e574776704
commit 173c374de0
6 changed files with 38 additions and 46 deletions

View File

@@ -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();

View File

@@ -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; } }
}

View File

@@ -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);