-
Notifications
You must be signed in to change notification settings - Fork 0
/
spellCardAdder
111 lines (106 loc) · 4.82 KB
/
spellCardAdder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import com.google.gson.Gson;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class SpellCardAdder {
public static void main(String[] args) throws IOException {
Gson gson = new Gson();
Scanner scanner = new Scanner(System.in);
while (true) {
ArrayList<logic.Spell> spells = new ArrayList<>();
System.out.println("what u scan here doesn't matter!!!");
String a=scanner.nextLine();
System.out.println("name:");
String name = scanner.nextLine();
System.out.println("id:");
int ID=Integer.parseInt(scanner.nextLine());
System.out.println("desc:");
String desc = scanner.nextLine();
System.out.println("price:");
String price = scanner.nextLine();
System.out.println("mana:");
String mana = scanner.nextLine();
System.out.println("num of spells:");
int num = scanner.nextInt();
for (int i = 0; i < num; i++) {
ArrayList<Integer> turns=new ArrayList<>();
ArrayList<Integer> locations=new ArrayList<>();
System.out.println("targetsNumber:");
String nfdgmjdr = scanner.nextLine();
String targetNumber = scanner.nextLine();
System.out.println("targetDistance:");
String targetDistance = scanner.nextLine();
System.out.println("effectQuantity:");
String effectQuantity = scanner.nextLine();
System.out.println("staticQuantity:");
String staticQuantity = scanner.nextLine();
System.out.println("index of time:");
String time = scanner.nextLine();
System.out.println("index of side:");
String side = scanner.nextLine();
System.out.println("index of effect:");
String effect = scanner.nextLine();
System.out.println("index of staticState");
String staticState = scanner.nextLine();
System.out.println("index of targetRange");
String targetRange = scanner.nextLine();
System.out.println("index of targetStatics");
String targetStatics = scanner.nextLine();
System.out.println("index of targetKind");
String targetKind = scanner.nextLine();
System.out.println("massacre:");
String massacre = scanner.nextLine();
System.out.println("immunity:");
String immunity = scanner.nextLine();
System.out.println("continuous:");
String continuous=scanner.nextLine();
System.out.println("choice");
String choice = scanner.nextLine();
System.out.println("goodness");
String goodness = scanner.nextLine();
System.out.println("eternity");
System.out.println("locationImportance:");
String locationImportance=scanner.nextLine();
String eternity = scanner.nextLine();
System.out.println("num of turns:");
int numt=scanner.nextInt();
if(numt!=0){
for (int j=0;j<numt;j++){
turns.add(0);
}
}
System.out.println("row:");
int row=scanner.nextInt();
System.out.println("column:");
int column=scanner.nextInt();
for (int j = 0; j < 2*row*column; j++) {
locations.add(0);
}
logic.Spell spell = new logic.Spell(targetNumber, targetDistance, effectQuantity, staticQuantity, time, side, effect, staticState, targetRange, targetStatics, targetKind, massacre, immunity,continuous, choice, goodness, eternity,locationImportance,turns,locations);
spells.add(spell);
}
logic.SpellCard spellCard = new logic.SpellCard(name,ID,desc,Integer.parseInt(price),Integer.parseInt(mana),spells);
String jsonString = gson.toJson(spellCard);
FileWriter fileWriter = new FileWriter("/home/dorna/IdeaProjects/project-42/SpellCards/" + name + ".json");
fileWriter.write(jsonString);
fileWriter.close();
}
}
}
class logic.SpellCard {
String name;
String desc;
int price;
int MP;
int ID;
ArrayList<logic.Spell> spells;
logic.SpellCard(String name,int ID, String desc, int price, int MP, ArrayList<logic.Spell> spells) {
this.name = name;
this.ID=ID;
this.desc = desc;
this.price = price;
this.MP = MP;
this.spells = spells;
}
}