Esempio n. 1
0
 /**
  * Takes <code>cannon</code> and inserts it into the proper table
  *
  * @param cannon
  */
 public void addCannon(Cannon cannon) {
   ContentValues values = new ContentValues();
   values.put("attachPoint", cannon.getAttachPoint().toString());
   values.put("emitPoint", cannon.getEmitPoint().toString());
   values.put("attackImage", cannon.getLaserShot().getAttackViewableInfo().getImage());
   values.put("attackImageHeight", cannon.getLaserShot().getAttackViewableInfo().getImageHeight());
   values.put("attackImageWidth", cannon.getLaserShot().getAttackViewableInfo().getImageWidth());
   values.put("attackSound", cannon.getLaserShot().getAttackSound());
   values.put("damage", cannon.getLaserShot().getDamage());
   values.put("image", cannon.getMainViewableInfo().getImage());
   values.put("imageWidth", cannon.getMainViewableInfo().getImageWidth());
   values.put("imageHeight", cannon.getMainViewableInfo().getImageHeight());
   long result = db.insert("cannons", null, values);
   //        if(result == -1) Log.i("JsonDomParserExample", "Failed to add cannon to db.");
   //        else Log.i("JsonDomParserExample", "Successfully added cannon to db");
 }