private void FillFieldObjects(FieldObjectType fieldObjectType, int countObjects, Field field) { Random random = new Random(); for (int i = 0; i < countObjects; i++) { field.GenerateNewRandomObject(fieldObjectType, random); } }
public void GenerateNewRandomObject(FieldObjectType fieldObjectType, Random random) { int index = random.Next(Grounds.Count); FieldObject fieldObject = Grounds[index]; fieldObject.ObjectType = fieldObjectType; FieldObjects.Add(fieldObject); Grounds.RemoveAt(index); }
public MovingObject(int x, int y, FieldObjectType fieldObjectType) : base(x, y, fieldObjectType) { }
public Bullet(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Bullet) { }
public Kolobok(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Kolobok) { }
public Tank(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Tank) { }
public FieldObject() { ObjectType = FieldObjectType.Empty; }
public FieldObject(int x, int y, FieldObjectType fieldObjectType) { Position = new Point(x, y); ObjectType = fieldObjectType; }