|
|
@ -4,6 +4,9 @@ namespace WebApplication1 |
|
|
{ |
|
|
{ |
|
|
public class RandomField : Field |
|
|
public class RandomField : Field |
|
|
{ |
|
|
{ |
|
|
|
|
|
private const int MaxTypeValue = 1; |
|
|
|
|
|
private const int MaxColorValue = 2; |
|
|
|
|
|
|
|
|
public RandomField(int iCount) |
|
|
public RandomField(int iCount) |
|
|
{ |
|
|
{ |
|
|
Random rr = new Random(); |
|
|
Random rr = new Random(); |
|
|
@ -11,10 +14,10 @@ namespace WebApplication1 |
|
|
{ |
|
|
{ |
|
|
this.Figures.Add(new Figure() |
|
|
this.Figures.Add(new Figure() |
|
|
{ |
|
|
{ |
|
|
FigureColor = rr.Next(2), |
|
|
FigureColor = rr.Next(MaxColorValue), |
|
|
FigureType = rr.Next(1), |
|
|
FigureType = rr.Next(MaxTypeValue) + 1, |
|
|
PosX = rr.Next(FigureMover.FieldXMin, FigureMover.FieldXMax), |
|
|
PosX = rr.Next(FigureMover.FieldXMin, FigureMover.FieldXMax + 1), |
|
|
PosY = rr.Next(FigureMover.FieldYMin, FigureMover.FieldYMax), |
|
|
PosY = rr.Next(FigureMover.FieldYMin, FigureMover.FieldYMax + 1), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|