Commit 3914fdd8 authored by Quentin's avatar Quentin
Browse files

add player definition

parent 661c1350
import { Pokemon, display } from "./pokemon";
export interface Player{
name : string
pokemons : Array<Pokemon>
}
//Modifie et retourne un joueur après le k.o. de son ième pokemon
//Prérequis : 0 <= entier(position) < nombre de pokemon
export function pokemonKo(player : Player,position : number) : Player{
console.log(player.pokemons[position].name+" est k.o.");
player.pokemons.splice(position,1); //retrait du pokemon de la liste
if(player.pokemons.length>0)
{
console.log(player.name+" fait appel à "+display(player.pokemons[0]));
}
return player;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment