Hello, i try to search if anyone ask it but i didn't understand any documentation :/
So my question is this : I have a file with some object on a JSON file and i want to import it to create object on an object list. How can I import it ?
I think I've made a bad start to my program, but here it is :
import java.util.ArrayList;
class Application{
public static void main(){
ArrayList<Cases> listOfCase;
}
}
class Cases {
int idCase;
String nom;
int whoOwn = 0; // Player id who own the propriety. -1 if not buyable
int price; // Price of the case
ArrayList<Integer> playerOnCase = new ArrayList<>();
boolean isMortgaged = false;
boolean canBuyHouse = false;
int color;
int effect; // 0 nothin | 1 jail | 2 special card | 3 pay
ArrayList<Integer> loyer = new ArrayList<>(); // loyer[nbHouse] : price need to pay to a player
int nbHouse = 0; // 0-5 for houses, 5th is an hotel
public Cases(int idCase, String nom, int whoOwn, int price, ArrayList<Integer> playerOnCase,
boolean isMortgaged, boolean canBuyHouse, int color, int effect, ArrayList<Integer> loyer, int nbHouse) {
this.idCase = idCase;
this.nom = nom;
this.whoOwn = whoOwn;
this.price = price;
this.playerOnCase = playerOnCase;
this.isMortgaged = isMortgaged;
this.canBuyHouse = canBuyHouse;
this.color = color;
this.effect = effect;
this.loyer = loyer;
this.nbHouse = nbHouse;
}
}