1
|
|
|
/** |
2
|
|
|
Copyright 2018 June Hanabi |
3
|
|
|
|
4
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
5
|
|
|
you may not use this file except in compliance with the License. |
6
|
|
|
You may obtain a copy of the License at |
7
|
|
|
|
8
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
9
|
|
|
|
10
|
|
|
Unless required by applicable law or agreed to in writing, software |
11
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
12
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13
|
|
|
See the License for the specific language governing permissions and |
14
|
|
|
limitations under the License. |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
import { Component } from '@angular/core'; |
18
|
|
|
import { SaveFileService } from "../../data/savefile.service"; |
19
|
|
|
import { WarpData } from '../../data/savefile-expanded/fragments/WarpData'; |
20
|
|
|
|
21
|
|
|
@Component({ |
22
|
|
|
selector: 'screen-area-warps', |
23
|
|
|
templateUrl: './area-warps.component.pug', |
24
|
|
|
styleUrls: ['./area-warps.component.scss'], |
25
|
|
|
}) |
26
|
|
|
export class AreaWarpsComponent { |
27
|
|
|
|
28
|
|
|
constructor( |
29
|
|
|
public fileService: SaveFileService |
30
|
|
|
) { } |
31
|
|
|
|
32
|
|
|
get warpPoints() { |
33
|
|
|
return this.fileService.fileDataExpanded.area.warps.warpData; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
addListItem() { |
37
|
|
|
this.fileService.fileDataExpanded.area.warps.warpData.push(new WarpData()); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
remListItem(index: number) { |
41
|
|
|
this.fileService.fileDataExpanded.area.warps.warpData.splice(index, 1); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
trackByFn(index: number) { |
45
|
|
|
return index; |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
|