You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
754 B

10 months ago
using System;
namespace WebApplication1
{
public class RandomField : Field
{
10 months ago
private const int MaxTypeValue = 1;
private const int MaxColorValue = 2;
10 months ago
public RandomField(int iCount)
{
Random rr = new Random();
for (int ii = 0; ii < iCount; ii++)
{
this.Figures.Add(new Figure()
{
10 months ago
FigureColor = rr.Next(MaxColorValue),
FigureType = rr.Next(MaxTypeValue) + 1,
PosX = rr.Next(FigureMover.FieldXMin, FigureMover.FieldXMax + 1),
PosY = rr.Next(FigureMover.FieldYMin, FigureMover.FieldYMax + 1),
10 months ago
});
}
}
}
}