+var WorldRemoveTouchEvent = enchant.Class.create(ATouchEvent,{
+ initialize: function (ctl){
+ this.ctl = ctl;
+ this.touchX = 0;
+ this.touchY = 0;
+ },
+ touchstart :function(e){
+ this.touchX = e.x - this.ctl.backgroundMap.x;
+ this.touchY = e.y - this.ctl.backgroundMap.y;
+ var tx = this.touchX;
+ var ty = this.touchY;
+ var nodes = this.ctl.getObjs();
+ // nodes.sort(ctl.def.nodeSort);
+ for (var id in nodes) {
+ var node = nodes[id];
+ var nx = node.getX();
+ var ny = node.getY();
+ if(node == null)continue;
+ // if(node instanceof Box
+ // || node instanceof this.ctl.def.Food
+ // || node instanceof this.ctl.def.Unun
+ // ){
+ // continue;
+ // }
+ if(node instanceof this.ctl.def.Yukkuri){
+ nx -= node.getWidth() / 2;
+ ny -= node.getHeight() / 2;
+ }
+ if( nx <= tx
+ && (nx + node.getWidth()) >= tx
+ && ny <= ty
+ && (ny + node.getHeight()) >= ty
+ ){
+ if(node instanceof this.ctl.def.Yukkuri){
+ mangMsg.output(node, EMsg.REMOVE_YUKKURI);
+ node.setFaceImage(EFace.CRY1);
+ }
+ else if(node instanceof this.ctl.def.Place){
+ node.removeAll();
+ }
+ else{
+ node.removeAll();
+ node.undefineAll();
+ }
+
+ break;
+ }
+ }
+ }
+});
+var WorldPicoPicoHummerTouchEvent = enchant.Class.create(ATouchEvent,{
+ initialize: function (ctl){
+ this.ctl = ctl;
+ this.touchX = 0;
+ this.touchY = 0;
+ },
+ touchstart :function(e){
+ // if(e.x >= 0 && e.x <= EFieldPos.WIDTH){
+ // var backgroundMap = this.ctl.backgroundMap;
+ // var tx = -backgroundMap.x + e.x;
+ // var ty = -backgroundMap.y + e.y;
+ // new ctl.def.Place("tree", tx, ty);
+ // }
+ }
+});