Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Item game: games) {
- //código para acceder a cada campo del Item.
- }
- Name: Subnautica (Game Preview)
- Type: ---
- Descripcion Castellano: Este juego es un trabajo en curso...
- Descripcion Pegi:
- Edad Pegi: 16+
- Microsoft Store ID: bx3s1q5dvhrd
- Microsoft Store URL: subnautica-game-preview/bx3s1q5dvhrd
- Nota: 4.0
- Pertenece a: -
- Tipología de juego: Juego,
- public String getNombre(){
- return this.nombre
- }
- for (Juego game: games) {
- System.out.println(game.getNombre());
- }
- Juego j;
- for (i = 0; i<10; i++){
- j = new Juego();
- games.add(j);
- }
- Juego j;
- for (i = 0; i<10; i++){
- j = new Juego("Juego "+i);
- games.add(j);
- }
- Juego j;
- for (i = 0; i<10; i++){
- j = new Juego();
- j.setNombre("Juego "+i);
- games.add(j);
- }
- public void setNombre (String nombre){
- this.nombre = nombre;
- }
- Iterator<Item> it = lista.iterator();
- // mientras al iterador queda proximo juego
- while(it.hasNext()){
- Item item=it.next();
- System.out.println(item.toString());
- System.out.println("tipo: " + item.tipo);
- }
- public class Item{
- public String nombre;
- public int type; // asumo codigo tres digitos?
- public String descCastellano;
- ...
- @Override
- public String toString(){
- return String.format("%s: %s", nombre, descCastellano);
- }
- }
- public class Juego{
- String titulo;
- //Constructor
- public Juego(String titulo)
- {
- this.titulo = titulo;
- }
- public String getTitulo()
- {
- return titulo;
- }
- }
- ArrayList<Juego> juegos = new ArrayList<Juego>();
- Juego juego = new Juego("lo que sea");
- juegos.add(juego);
- for (Juego game: juegos) {
- System.out.println(game.getTitulo());
- }
- item.getValues().put(Constants.PERTENECE, pertenece_a)
- game.getValues().get(Constants.PERTENECE)
Add Comment
Please, Sign In to add comment