home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / src / como / commlet / nicnacnoe / piece.java < prev   
Encoding:
Java Source  |  1996-08-14  |  591 b   |  36 lines

  1. package como.commlet.nicnacnoe;
  2.  
  3. import java.io.*;
  4. import como.io.*;
  5.  
  6. public class Piece implements Saveable {
  7. int x,y,p,nextTurn;
  8.  
  9. public Piece() {
  10.     }
  11.  
  12. public Piece(int x,int y,int p,int n) {
  13.     this.x = x;
  14.     this.y = y;
  15.     this.p = p;
  16.     }
  17. public Piece(int x,int y,int p) {
  18.     this.x = x;
  19.     this.y = y;
  20.     this.p = p;
  21.     }
  22. public void load(ObjectInputStream o) throws IOException  {
  23.     x = o.readInt();
  24.     y = o.readInt();
  25.     p = o.readInt();
  26.     nextTurn = o.readInt();
  27.     }
  28. public void save(ObjectOutputStream o)  throws IOException {
  29.     o.writeInt(x);
  30.     o.writeInt(y);
  31.     o.writeInt(p);
  32.     o.writeInt(nextTurn);
  33.     }
  34. }
  35.  
  36.