File size: 578 Bytes
4ee4376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as CONST from '../../constants';
import layer from './layer';

export default class terrain extends layer {
  constructor (options) {
    options.type = CONST.T_TERRAIN;
    super(options);
    this.showUnderwater = false;
  }


  onHide (type) {
    if (type == CONST.T_HEIGHTMAP) this.show(false);

    if (type == CONST.T_WATER) {
      this.showUnderwater = true;
      this.show();
    }
  }


  onShow (type) {
    if (type == CONST.T_HEIGHTMAP) this.hide(false);

    if (type == CONST.T_WATER) {
      this.showUnderwater = false;
      this.show();
    }
  }
}