rust/landgen/src/template_based.rs
changeset 14095 b2feb190e4bc
parent 14078 bf40b5f938b0
child 14100 4d22be35cfa2
equal deleted inserted replaced
14094:d0b0d61b7d5e 14095:b2feb190e4bc
    30 
    30 
    31         // mirror
    31         // mirror
    32         if self.outline_template.can_mirror {
    32         if self.outline_template.can_mirror {
    33             if let Some(b) = random_numbers.next() {
    33             if let Some(b) = random_numbers.next() {
    34                 if b & 1 != 0 {
    34                 if b & 1 != 0 {
    35                     points
    35                     points.mirror();
    36                         .iter_mut()
       
    37                         .for_each(|p| p.x = land.width() as i32 - 1 - p.x);
       
    38                 }
    36                 }
    39             }
    37             }
    40         }
    38         }
    41 
    39 
    42         // flip
    40         // flip
    43         if self.outline_template.can_flip {
    41         if self.outline_template.can_flip {
    44             if let Some(b) = random_numbers.next() {
    42             if let Some(b) = random_numbers.next() {
    45                 if b & 1 != 0 {
    43                 if b & 1 != 0 {
    46                     points
    44                     points.flip();
    47                         .iter_mut()
       
    48                         .for_each(|p| p.y = land.height() as i32 - 1 - p.y);
       
    49                 }
    45                 }
    50             }
    46             }
    51         }
    47         }
    52 
    48 
    53         points.distort(random_numbers);
    49         points.distort(random_numbers);