コード例 #1
0
 public synchronized void buddy(int id, int frame, String name, int group, int type) {
   Gob g = getgob(id, frame);
   if (g == null) return;
   if ((name.length() == 0) && (group == 0) && (type == 0)) {
     g.delattr(KinInfo.class);
   } else {
     KinInfo b = g.getattr(KinInfo.class);
     if (b == null) {
       g.setattr(new KinInfo(g, name, group, type));
     } else {
       b.update(name, group, type);
     }
   }
 }
コード例 #2
0
 public synchronized void drawoff(int id, int frame, Coord off) {
   Gob g = getgob(id, frame);
   if (g == null) return;
   if ((off.x == 0) && (off.y == 0)) {
     g.delattr(DrawOffset.class);
   } else {
     DrawOffset dro = g.getattr(DrawOffset.class);
     if (dro == null) {
       dro = new DrawOffset(g, off);
       g.setattr(dro);
     } else {
       dro.off = off;
     }
   }
 }
コード例 #3
0
 public synchronized void speak(int id, int frame, Coord off, String text) {
   Gob g = getgob(id, frame);
   if (g == null) return;
   if (text.length() < 1) {
     g.delattr(Speaking.class);
   } else {
     Speaking m = g.getattr(Speaking.class);
     if (m == null) {
       g.setattr(new Speaking(g, off, text));
     } else {
       m.off = off;
       m.update(text);
     }
   }
 }
コード例 #4
0
 public synchronized void follow(int id, int frame, int oid, Coord off, int szo) {
   Gob g = getgob(id, frame);
   if (g == null) return;
   if (oid == -1) {
     g.delattr(Following.class);
   } else {
     Following flw = g.getattr(Following.class);
     if (flw == null) {
       flw = new Following(g, oid, off, szo);
       g.setattr(flw);
     } else {
       flw.tgt = oid;
       flw.doff = off;
       flw.szo = szo;
     }
   }
 }
コード例 #5
0
 public synchronized void linstep(int id, int frame, int l) {
   boolean isplayer = isplayerid(id);
   Gob g = getgob(id, frame);
   if (g == null) return;
   Moving m = g.getattr(Moving.class);
   if ((m == null) || !(m instanceof LinMove)) return;
   LinMove lm = (LinMove) m;
   if ((l < 0) || (l >= lm.c)) {
     g.delattr(Moving.class);
     if (isplayer) {
       ismoving = false;
       checkqueue();
     }
   } else {
     lm.setl(l);
     if (isplayer) {
       ismoving = true;
     }
   }
 }
コード例 #6
0
 public synchronized void homostop(int id, int frame) {
   Gob g = getgob(id, frame);
   if (g == null) return;
   g.delattr(Homing.class);
 }