Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Tile {
- private boolean present;
- private int tiletype; //0-4
- private int orientation; //0-3
- private boolean bolted;
- private boolean star;
- private boolean flag;
- //-------initializers-------/
- public Tile() {
- present = true;
- tiletype = 0;
- orientation = 0;
- bolted = false;
- star = false;
- flag = false;
- }
- //-------accessors-------//
- public boolean isPresent() {
- return present;
- }
- public boolean isBolted() {
- return bolted;
- }
- public boolean containsStar() {
- return star;
- }
- public int getType() {
- return tiletype;
- }
- public int getOrientation() {
- return orientation;
- }
- public boolean isFlagged() {
- return flag;
- }
- //-------mutators-------//
- public void copyProperties(Tile t) {
- present = t.isPresent();
- tiletype = t.getType();
- orientation = t.getOrientation();
- bolted = t.isBolted();
- star = t.containsStar();
- }
- public void setProperties(int t, int o) {
- present = true;
- tiletype = t;
- orientation = o;
- }
- public void setProperties(int[] data) {
- present = true;
- tiletype = data[0];
- orientation = data[1];
- }
- public void setPresent(boolean p) {
- present = p;
- }
- public void setBolted(boolean b) {
- bolted = b;
- }
- public void containsStar(boolean s) {
- star = s;
- }
- public void setType(int t) {
- tiletype = t;
- }
- public void setOrientation(int o) {
- orientation = o;
- }
- public void setFlagged(boolean f) {
- flag = f;
- }
- public void rotate() {
- orientation = (orientation+1) % 4;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement