Package beans.serializable

Examples of beans.serializable.Objet


            statement.setString(1, name);
           
            set = statement.executeQuery();
           
            if (set.next()) {
                final Objet objet = getFromRowSet(set);
                return objet;
            } else {
                return null;
            }
        } catch (final SQLException ex) {
View Full Code Here


        }
    }

    private static Objet getFromRowSet(final ResultSet set) {
        try {
            final Objet objet = new Objet();
            objet.setName(set.getString(NAME));
            objet.setDescription(set.getString(DESCRIPTION));
            objet.setChangeStatut(changeStatutControl.getChangeStatut(objet.getName(), TABLE_NAME));
            objet.setTarget(Target.valueOf(set.getString(TARGET)));
            objet.setUse(Utilization.valueOf(set.getString(USE)));
            return objet;
        } catch (SQLException ex) {
            Logger.getLogger(ObjetControl.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
View Full Code Here

            statement = Database.getStatement("select * from "+TABLE_NAME);
           
            set = statement.executeQuery();
           
            while (set.next()) {
                final Objet objet = getFromRowSet(set);
                objets.add(objet);
            }
            return objets;
        } catch (final SQLException ex) {
            Logger.getLogger(SkillControl.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

        for (final Skill skill : perso.getSkills()) {
            persoJunctionControl.saveJunction(perso.getName(), skill.getName());
        }
        persoJunctionControl = new PersoJunctionControl(PERSO_OBJET);
        for (final Entry<Objet, Integer> entry : perso.getObjets().entrySet()) {
            final Objet objet = entry.getKey();
            final int nombre = entry.getValue();
            persoJunctionControl.saveJunction(perso.getName(), objet.getName(), nombre);
        }
    }
View Full Code Here

        final String imagePath = fields.get("image");
        final int lifeMax = Integer.parseInt(fields.get("life"));
        final int manaMax = Integer.parseInt(fields.get("mana"));
        final int attaque = Integer.parseInt(fields.get("attaque"));
        final int defense = Integer.parseInt(fields.get("defense"));
        final Objet loot = (Objet) GeneralConstant.deSerialize(GeneralConstant.SAVE_OBJECT_PATH + fields.get("loot"));
        final Monster monster = new Monster(name, 10, imagePath, lifeMax, manaMax, attaque, defense, loot);
        GeneralConstant.serialize(GeneralConstant.SAVE_MONSTER_PATH + name, monster);
    }
View Full Code Here

        final String sName = name.getText();
        final String sDescr = description.getText();
        final Target sTarget = (Target)target.getSelectedItem();
        final Utilization sUse = (Utilization)use.getSelectedItem();
       
        final Objet objet = new Objet (sName, sDescr, sTarget, listChangeStatut, sUse);
        guiModel.initObjectPopUpResponse(objet);
        this.reset();
    }//GEN-LAST:event_SaveJButtonActionPerformed
View Full Code Here

        final Image imageListScreen = listScreen.getImage();
        if (imageListScreen != null) {
            graphic.drawImage(listScreen.getImage(), 20, 50, null);
        }

        Objet currentObjet = objets.getCurrentObjet();
        if (currentObjet != null) {
            //Affichage de la description
            graphic.drawImage(Alphabet.createString(currentObjet.getDescription().toString(), image.getWidth()), 20, image.getHeight() - 100, null);
            //Affichage de la cible
            final Target target = currentObjet.getTarget();
            if (target != null) {
                graphic.drawImage(Alphabet.createString("Cible : " + currentObjet.getTarget().toString(), image.getWidth()), 20, image.getHeight() - 50, null);
            }
        }
        graphic.dispose();
        return image;
    }
View Full Code Here

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void acceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptActionPerformed
        final Objet objet = (Objet) itemBox.getSelectedItem();
        final int nombre = Integer.parseInt(quantity.getText());
        choiceTemplate.addChoiceObjet(objet, nombre);
        this.dispose();
    }//GEN-LAST:event_acceptActionPerformed
View Full Code Here

        stats.setSpells(new ArrayList<Spell>());

        final Map<Objet, Integer> objets = new HashMap<Objet, Integer>();
        List<ChangeStatut> changeStat = new ArrayList<ChangeStatut>();
        changeStat.add(new ChangeStatut(Type.HEAL, Element.AQUA, 10, Stat.DEXTERITY, Stat.HP));
        Objet objet = new Objet("Potion", "Soin", Target.ALLY, changeStat, Utilization.TWICE);
        objets.put(objet, 1);
       
        changeStat = new ArrayList<ChangeStatut>();
        changeStat.add(new ChangeStatut(Type.HEAL, Element.AQUA, 10, Stat.DEXTERITY, Stat.MP));
        objet = new Objet("Potion mana", "Magie", Target.ALLY, changeStat, Utilization.TWICE);
        objets.put(objet, 1);
       
        changeStat = new ArrayList<ChangeStatut>();
        objet = new Equipment("Epee", "Epee basique en bois", TypeEquipment.WEAPON, Panoply.NONE, 5, 3, 10, 10);
        objets.put(objet, 1);
View Full Code Here

TOP

Related Classes of beans.serializable.Objet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.