added type definition
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
import { invoke } from "@tauri-apps/api/tauri";
|
||||
import AutoComplete from "simple-svelte-autocomplete";
|
||||
import attack_types from "../const/attack_types.json";
|
||||
import type { PokemonData } from "../model/PokemonStatus";
|
||||
|
||||
export let player1Data;
|
||||
export let player2Data;
|
||||
export let player1Data: PokemonData | undefined;
|
||||
export let player2Data: PokemonData | undefined;
|
||||
let attackData;
|
||||
$: {
|
||||
if (myValue > 0 && myValue !== currentValue) {
|
||||
@@ -62,13 +63,13 @@
|
||||
minDamage: 0,
|
||||
// 攻撃側タイプ
|
||||
// TODO: try catchでエラーハンドリング
|
||||
atk_type: JSON.parse(attacker.types), // 配列なのでjson parse
|
||||
atk_type: attacker.types,
|
||||
atk_terastype: attacker.terastype,
|
||||
// 防御側タイプ
|
||||
def_type:
|
||||
defender.terastype[0] > 0
|
||||
? defender.terastype
|
||||
: JSON.parse(defender.types),
|
||||
: defender.types,
|
||||
|
||||
// 技タイプ
|
||||
move_type: JSON.parse(attackData.types),
|
||||
|
||||
Reference in New Issue
Block a user