コード例 #1
0
 /*    */ public Sprite create(Sprite.Owner owner, Resource res, Message sdt) {
   /* 61 */ int m = sdt.uint8();
   /* 62 */ GrowingPlant spr = new GrowingPlant(owner, res);
   /* 63 */ spr.addnegative();
   /* 64 */ Random rnd = owner.mkrandoom();
   /* 65 */ for (int i = 0; i < this.num; i++) {
     /* 66 */ Coord c =
         new Coord(rnd.nextInt(this.neg.bs.x), rnd.nextInt(this.neg.bs.y)).add(this.neg.bc);
     /* 67 */ Tex s = this.strands[m][rnd.nextInt(this.strands[m].length)];
     /* 68 */ spr.add(s, 0, MapView.m2s(c), new Coord(s.sz().x / 2, s.sz().y).inv());
     /*    */ }
   /* 70 */ return spr;
   /*    */ }
 public Sprite create(Owner owner, Resource res, Message sdt) {
   int m = sdt.uint8();
   GrowingPlant spr = new GrowingPlant(owner, res);
   spr.addnegative();
   Random rnd = owner.mkrandoom();
   int n = Config.simple_plants ? 1 : num;
   for (int i = 0; i < n; i++) {
     Coord c;
     if (Config.simple_plants) {
       c = neg.bc.add(neg.bs).sub(5, 5);
     } else {
       c = new Coord(rnd.nextInt(neg.bs.x), rnd.nextInt(neg.bs.y)).add(neg.bc);
     }
     Tex s = strands[m][rnd.nextInt(strands[m].length)];
     spr.add(s, 0, MapView.m2s(c), new Coord(s.sz().x / 2, s.sz().y).inv());
   }
   return (spr);
 }