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.
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace WebApplication1
|
|
|
|
|
{
|
|
|
|
|
public class RandomField : Field
|
|
|
|
|
{
|
|
|
|
|
private const int MaxTypeValue = 1;
|
|
|
|
|
private const int MaxColorValue = 2;
|
|
|
|
|
|
|
|
|
|
public RandomField(int iCount)
|
|
|
|
|
{
|
|
|
|
|
Random rr = new Random();
|
|
|
|
|
for (int ii = 0; ii < iCount; ii++)
|
|
|
|
|
{
|
|
|
|
|
this.Figures.Add(new Figure()
|
|
|
|
|
{
|
|
|
|
|
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),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|