added 'self' to IPips.GetPips
This commit is contained in:
@@ -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]);
|
||||||
|
|||||||
@@ -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++)
|
||||||
|
|||||||
@@ -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++)
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user