Open main menu

lensowiki β

Changes

Computer Science/61b/Projects/Network/player/Chip.java

950 bytes added, 07:24, 22 September 2007
no edit summary
{{code}}
package player;

//
// Chip.java
// abstract data type to hold information about chips
// color field stores the chip's color as a static final int; x and y fields store the chip's x and y coords, respectively
// Created by Paul Borokhov on 10/28/06.
//

public class Chip {
public static final int BLACK = 0;
public static final int WHITE = 1;

private int color;
private int x;
private int y;
// when checking for a network, lets us know if we've already used this chip in the network
private boolean checked;

public Chip(int col, int xi, int yi) {
color = col;
x = xi;
y = yi;
}

public int getColor() {
return color;
}

public int getX() {
return x;
}

public int getY() {
return y;
}

public boolean Checked() {
return checked;
}

// changes the checked state of the chip as needed
public void setChecked(boolean newval) {
checked = newval;
}
}
1,277
edits