added 'self' to IPips.GetPips

This commit is contained in:
Chris Forbes
2010-01-05 12:26:10 +13:00
parent 512e56aec7
commit 52f99cb055
6 changed files with 6 additions and 6 deletions

View File

@@ -211,7 +211,7 @@ namespace OpenRa.Game.Graphics
foreach (var pips in selectedUnit.traits.WithInterface<IPips>()) foreach (var pips in selectedUnit.traits.WithInterface<IPips>())
{ {
foreach (var pip in pips.GetPips()) foreach (var pip in pips.GetPips(selectedUnit))
{ {
var pipImages = new Animation("pips"); var pipImages = new Animation("pips");
pipImages.PlayRepeating(pipStrings[(int)pip]); pipImages.PlayRepeating(pipStrings[(int)pip]);

View File

@@ -55,7 +55,7 @@ namespace OpenRa.Game.Traits
} }
// Display 5 pips indicating the current charge status // Display 5 pips indicating the current charge status
public IEnumerable<PipType> GetPips() public IEnumerable<PipType> GetPips(Actor self)
{ {
const int numPips = 5; const int numPips = 5;
for (int i = 0; i < numPips; i++) for (int i = 0; i < numPips; i++)

View File

@@ -57,7 +57,7 @@ namespace OpenRa.Game.Traits
} }
} }
public IEnumerable<PipType> GetPips() public IEnumerable<PipType> GetPips(Actor self)
{ {
const int numPips = 7; const int numPips = 7;
for (int i = 0; i < numPips; i++) for (int i = 0; i < numPips; i++)

View File

@@ -23,7 +23,7 @@ namespace OpenRa.Game.Traits
public void Attacking(Actor self) { --ammo; } public void Attacking(Actor self) { --ammo; }
public IEnumerable<PipType> GetPips() public IEnumerable<PipType> GetPips(Actor self)
{ {
return Graphics.Util.MakeArray(self.Info.Ammo, return Graphics.Util.MakeArray(self.Info.Ammo,
i => ammo > i ? PipType.Green : PipType.Transparent); i => ammo > i ? PipType.Green : PipType.Transparent);

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Game.Traits
this.self = self; this.self = self;
} }
public IEnumerable<PipType> GetPips() public IEnumerable<PipType> GetPips(Actor self)
{ {
for (int i = 0; i < self.Info.OrePips; i++) for (int i = 0; i < self.Info.OrePips; i++)
{ {

View File

@@ -29,7 +29,7 @@ namespace OpenRa.Game.Traits
interface IDamageModifier { float GetDamageModifier(); } interface IDamageModifier { float GetDamageModifier(); }
interface ISpeedModifier { float GetSpeedModifier(); } interface ISpeedModifier { float GetSpeedModifier(); }
interface IPaletteModifier { void AdjustPalette(Bitmap b); } interface IPaletteModifier { void AdjustPalette(Bitmap b); }
interface IPips { IEnumerable<PipType> GetPips(); } interface IPips { IEnumerable<PipType> GetPips(Actor self); }
interface ITags { IEnumerable<TagType> GetTags(); } interface ITags { IEnumerable<TagType> GetTags(); }
interface IMovement interface IMovement
{ {