Merge pull request #10143 from Phrohdoh/interface-reflection

Implement a utility command to check for explicit interface implementation violations.
This commit is contained in:
Oliver Brakmann
2016-01-18 20:23:43 +01:00
14 changed files with 150 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits
value = current != null ? 1 - (float)current.RemainingCost / current.TotalCost : 0;
}
public float GetValue()
float ISelectionBar.GetValue()
{
// only people we like should see our production status.
if (!self.Owner.IsAlliedWith(self.World.RenderPlayer))
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits
return value;
}
public Color GetColor() { return info.Color; }
Color ISelectionBar.GetColor() { return info.Color; }
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
this.info = info;
}
public float GetValue()
float ISelectionBar.GetValue()
{
if (!self.Owner.IsAlliedWith(self.World.RenderPlayer))
return 0;
@@ -46,6 +46,6 @@ namespace OpenRA.Mods.Common.Traits
return 1 - (float)power.RemainingTime / power.TotalTime;
}
public Color GetColor() { return info.Color; }
Color ISelectionBar.GetColor() { return info.Color; }
}
}

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
value = remaining * 1f / duration;
}
public float GetValue()
float ISelectionBar.GetValue()
{
if (!self.Owner.IsAlliedWith(self.World.RenderPlayer))
return 0;
@@ -55,6 +55,6 @@ namespace OpenRA.Mods.Common.Traits
return value;
}
public Color GetColor() { return info.Color; }
Color ISelectionBar.GetColor() { return info.Color; }
}
}