moved growth/spread control onto ResourceType

This commit is contained in:
Chris Forbes
2010-03-03 21:30:31 +13:00
parent 15b82830a2
commit 9b0d8b8f3b
6 changed files with 37 additions and 16 deletions

View File

@@ -159,7 +159,7 @@ namespace OpenRA.Traits
++content[i, j].density;
}
public void Spread(ResourceTypeInfo info, Random r, float chance)
public void Spread(ResourceTypeInfo info)
{
var map = w.Map;
@@ -170,7 +170,6 @@ namespace OpenRA.Traits
for (int j = minj; j < maxj; j++)
for (int i = mini; i < maxi; i++)
if (content[i,j].type == null
&& r.NextDouble() < chance
&& GetAdjacentCellsWith(info, i,j ) > 0
&& w.IsCellBuildable(new int2(i, j), UnitMovementType.Wheel))
growMask[i, j] = true;