62 lines
1.2 KiB
TypeScript
62 lines
1.2 KiB
TypeScript
class Personagem{
|
|
nome: string;
|
|
raro: boolean;
|
|
best_const: number;
|
|
|
|
constructor(nome: string, raro: boolean, best_const: number){
|
|
this.nome = nome;
|
|
this.raro = raro;
|
|
this.best_const = best_const;
|
|
}
|
|
}
|
|
const personagens: Personagem[] = [
|
|
new Personagem("Xiangling", false, 4),
|
|
new Personagem("Xingqiu", false, 3),
|
|
new Personagem("Dehya", true, 5)
|
|
]
|
|
|
|
|
|
|
|
function main(){
|
|
const menuPrincipal = `
|
|
1. Criar
|
|
2. Listar
|
|
3. Atualizar
|
|
4. Excluir
|
|
5. Sair
|
|
|
|
Selecione uma opção: `
|
|
while(true){
|
|
let option: number = parseInt(prompt(menuPrincipal));
|
|
if(option === 5) break;
|
|
|
|
if(option === 1){
|
|
create();
|
|
}else if(option === 2){
|
|
read();
|
|
}else if(option === 3){
|
|
update();
|
|
}else if(option === 4){
|
|
del();
|
|
}
|
|
}
|
|
}
|
|
function create(nome: string, raro: boolean, best_const: number){
|
|
}
|
|
|
|
function read(){
|
|
console.log("Listando. . .");
|
|
}
|
|
|
|
function update(){
|
|
console.log("Atualizando. . .");
|
|
}
|
|
|
|
function del(){
|
|
console.log("Deletando. . .");
|
|
}
|
|
|
|
|
|
|
|
main()
|