Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package GranCombat;
- import java.util.Scanner;
- /**
- *
- * @author Marco, atafar
- */
- public class Vista {
- static void fraseInicio() {
- System.out.println("Descripcio del Jugador:");
- }
- static void fraseSigue() {
- System.out.println("Descripcio del nou Jugador:");
- }
- public static boolean comprobarValores(int fue, int con, int tam, int des, int per) {
- if ((fue < 3) || (fue > 18) || (con < 3) || (con > 18) || (tam < 3)
- || (tam > 18) || (des < 3) || (des > 18) || (per < 3) || (per > 18)) {
- System.out.println("Les característiques han d'estar entre 3 i 18");
- return false;
- }
- if (fue + con + tam + des + per > Principal.maxCaract) {
- System.out.println("La suma de les característiques ha de ser menor o igual a" + Principal.maxCaract);
- return false;
- }
- return true;
- }
- public static String obtenerNombreLuchador() {
- System.out.print("Nom del lluitador1: ");
- Scanner in = new Scanner(System.in);
- String nombre = in.nextLine();
- return nombre;
- }
- public static String obtenerFUE() {
- Scanner in = new Scanner(System.in);
- System.out.print("Força: ");
- String entrada = in.nextLine();
- return entrada;
- }
- public static String obtenerCON() {
- Scanner in = new Scanner(System.in);
- System.out.print("Constitució: ");
- String entrada = in.nextLine();
- return entrada;
- }
- public static String obtenerTAM() {
- Scanner in = new Scanner(System.in);
- System.out.print("Tamany: ");
- String entrada = in.nextLine();
- return entrada;
- }
- public static String obtenerDES() {
- Scanner in = new Scanner(System.in);
- System.out.print("Destresa: ");
- String entrada = in.nextLine();
- return entrada;
- }
- public static String obtenerPER() {
- Scanner in = new Scanner(System.in);
- System.out.print("Personalitat: ");
- String entrada = in.nextLine();
- return entrada;
- }
- public static int obtenerEscuela() {
- Scanner in = new Scanner(System.in);
- System.out.println("Escola: ");
- System.out.println(" 0 -- Follet Tortuga");
- System.out.println(" 1 -- Corb Genial");
- System.out.println(" 2 -- Hoi-Poi");
- System.out.println(" 3 -- Namac");
- System.out.println(" 4 -- Ninguna");
- String opcio = in.nextLine();
- int escola = Integer.parseInt(opcio);
- return escola;
- }
- /**
- * Función que pregunta al usuario si quiere continuar el combate
- *
- * @return devuelve su respuesta.
- */
- public static boolean repetir() {
- System.out.print("Deseas que el ganador se enfrente a un nuevo contrincante (S/N)?");
- Scanner in = new Scanner(System.in);
- String entrada = "";
- while (entrada.length() < 1) {
- entrada = in.nextLine();
- }
- return entrada.equals("N") || entrada.equals("n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement