Exemple #1
0
        private void FillFieldObjects(FieldObjectType fieldObjectType, int countObjects, Field field)
        {
            Random random = new Random();

            for (int i = 0; i < countObjects; i++)
            {
                field.GenerateNewRandomObject(fieldObjectType, random);
            }
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public MovingObject(int x, int y, FieldObjectType fieldObjectType) : base(x, y, fieldObjectType)
 {
 }
Exemple #4
0
 public Bullet(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Bullet)
 {
 }
Exemple #5
0
 public Kolobok(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Kolobok)
 {
 }
Exemple #6
0
 public Tank(int x, int y, FieldObjectType fieldObjectType) : base(x, y, FieldObjectType.Tank)
 {
 }
Exemple #7
0
 public FieldObject()
 {
     ObjectType = FieldObjectType.Empty;
 }
Exemple #8
0
 public FieldObject(int x, int y, FieldObjectType fieldObjectType)
 {
     Position   = new Point(x, y);
     ObjectType = fieldObjectType;
 }