Replace ResourceLayer references with IResourceLayer in traits/warheads.

This commit is contained in:
Paul Chote
2021-03-07 17:31:26 +00:00
committed by reaperrr
parent 5adcbe4c78
commit dcd8eccee4
14 changed files with 72 additions and 80 deletions

View File

@@ -663,6 +663,22 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> RenderPreview(WorldRenderer wr, TerrainTemplateInfo template, WPos origin);
}
public interface IResourceLayerInfo : ITraitInfoInterface { }
[RequireExplicitImplementation]
public interface IResourceLayer
{
event Action<CPos, ResourceType> CellChanged;
ResourceLayerContents GetResource(CPos cell);
bool CanAddResource(ResourceType resourceType, CPos cell, int amount = 1);
int AddResource(ResourceType resourceType, CPos cell, int amount = 1);
int RemoveResource(ResourceType resourceType, CPos cell, int amount = 1);
void ClearResources(CPos cell);
bool IsVisible(CPos cell);
bool IsEmpty { get; }
}
[RequireExplicitImplementation]
public interface IResourceRenderer
{