import { Component, Input, Output, EventEmitter } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MatCardModule } from '@angular/material/card'; import { GamePlan } from '../../../core/models/plan.model'; @Component({ selector: 'app-plan-game', standalone: true, imports: [ CommonModule, MatCardModule ], template: ` {{ game.game_name }} Pokémon to catch: {{ getTotalCatchCount() }} `, styles: [` .game-card { width: 200px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; } .game-card:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); } .game-card.selected { border: 2px solid #4CAF50; transform: translateY(-4px); } .game-image { width: 100%; height: 160px; object-fit: cover; } mat-card-content { padding: 16px; } h3 { margin: 0; font-size: 1.2em; color: #333; } .catch-count { margin: 8px 0 0; color: #666; } `] }) export class PlanGameComponent { @Input() game!: GamePlan; @Input() isSelected = false; @Output() gameSelect = new EventEmitter(); getTotalCatchCount(): number { return this.game.pokemon.reduce((sum, pokemon) => sum + pokemon.catch_count, 0); } getGameBoxArt(): string { // You'll need to implement this to return the correct box art URL return `/assets/images/games/${this.game.game_name.toLowerCase().replace(' ', '-')}.png`; } onSelect() { this.gameSelect.emit(this.game); } }
Pokémon to catch: {{ getTotalCatchCount() }}