それで、私は昨日 Java を独学し始めたばかりで、無限の退屈の中で、私が知っていることを少しテストすることに決め、単純なテキストベースのゲームを作ろうとしています。スキャナーを使用して、プレーヤーにどのクラスになりたいかを尋ねていますが、コードを実行すると、何も入力できません。これまでの私のコードは次のとおりです
import java.util.Scanner;
public class mainscript {
public static void main(String args[]){
System.out.println("Welcome to your first quest, young lord.");
System.out.println("In this quest, you will face many foes.");
System.out.println("What type of warrior are you, Sire?");
System.out.println("[use propper caps](Warrior, Rogue, Mage, Brute)");
Scanner c = new Scanner(System.in);
Scanner Warrior = null;
Scanner Rogue = null;
Scanner Mage = null;
if (c == Warrior){//c = class
System.out.println("So you are a warrior.");
System.out.println("You come equipped with the following items.");
System.out.println("Sword(20), Shield(10), Gold(20), and 50 points of health.");
System.out.println("Defeat enemies and do side quests to earn more money for items.");
int Sword, Shield, Health, Money;
Sword = 20;
Shield = 10;
Health = 50;
Money = 20;
}else if(c == Rogue){
System.out.println("So you are a Rogue.");
System.out.println("You are equipped with the following items.");
System.out.println("Dagger(20), Gloves(50), Buckler(10), Gold(20) and 40 points of health");
System.out.println("Defeat enemies and do side quests to earn more money for items.");
System.out.println("Alternately, use your Gloves to steal gold from your enemies in combat.");
int Dagger, Gloves, Buckler, Money, Health;
Dagger = 20;
Gloves = 50;
Buckler = 20;
Money = 20;
Health = 40;
}else if(c == Mage){
System.out.println("So you are a Mage.");
System.out.println("You are equipped with the following items.");
System.out.println("");
System.out.println("Defeat enemies and do side quests to earn more money for items.");
int Knife, Mana, Health;
}
}
}
Eclipse でコードを実行するときに何も入力できないのはなぜかと思っています。繰り返しますが、私はプログラミングに非常に慣れていないので、私の間違いを理解できるようにそれに応じて答えていただければ幸いです。