Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Paranoiaque committed Aug 7, 2024
1 parent 35a7241 commit d74de54
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ unit.name }}
</h5>
<h5 class="modal-title">{{ unit.name }}</h5>
<button
type="button"
class="btn-close"
Expand All @@ -12,9 +11,7 @@ <h5 class="modal-title">{{ unit.name }}
</div>
<div class="modal-body container-fluid">
{{ unit | json }}
<button class="btn btn-primary"
(click)="engage()"
translate>
<button class="btn btn-primary" (click)="engage()" translate>
Engage
</button>
</div>
Expand Down
34 changes: 17 additions & 17 deletions src/app/attacks/attacks-seabattles-engage-popup.sub-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ import { AttacksSeabattlesComponent } from './attacks-seabattles.component';
styleUrls: ['./attacks.component.css', './attacks-seabattles.component.css'],
})
export class AttacksSeabattlesEngagePopupSubComponent extends AttacksSeabattlesComponent {
@Input() case!:{
case_type: number,
can_engage: number,
color_id: number,
username: string,
x: number,
y: number,
bireme: number,
trireme: number,
quadrireme: number,
leviathan: number,
@Input() case!: {
case_type: number;
can_engage: number;
color_id: number;
username: string;
x: number;
y: number;
bireme: number;
trireme: number;
quadrireme: number;
leviathan: number;
};
@Input() unit!:{
name: string,
code: string,
attack: number,
defense: number,
cost: number,
@Input() unit!: {
name: string;
code: string;
attack: number;
defense: number;
cost: number;
};

constructor(
Expand Down
31 changes: 19 additions & 12 deletions src/app/attacks/attacks-seabattles.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ export class AttacksSeabattlesComponent implements OnInit, OnDestroy {
});
this.socket.on('sbGetCase', (data: object) => {
this.currentCase = data as typeof this.currentCase;
const name = this.currentCase.x.toString() + '_' + this.currentCase.y.toString();
(this.sbData.sb_map[name as keyof typeof this.sbData.sb_map] as object) = this.currentCase;
const name =
this.currentCase.x.toString() + '_' + this.currentCase.y.toString();
(this.sbData.sb_map[name as keyof typeof this.sbData.sb_map] as object) =
this.currentCase;
});
this.socket.on('sbJoin', (data: object) => {
this.sbData = data as typeof this.sbData;
Expand Down Expand Up @@ -148,17 +150,22 @@ export class AttacksSeabattlesComponent implements OnInit, OnDestroy {
}

getUnits() {
const list:{
attack: number,
defense: number,
cost: number,
code: string
const list: {
attack: number;
defense: number;
cost: number;
code: string;
}[] = [];
for(const [code, unit] of Object.entries(this.user.getDatas().sea_battles.units)) {
list.push({...unit, ...{
code: code,
name: Tools.getName(code),
}});
for (const [code, unit] of Object.entries(
this.user.getDatas().sea_battles.units
)) {
list.push({
...unit,
...{
code: code,
name: Tools.getName(code),
},
});
}
return list;
}
Expand Down

0 comments on commit d74de54

Please sign in to comment.