Commit 297a75c7 authored by Haj Rezvan's avatar Haj Rezvan

The program updated to version 0.1.

calling "setMapByPosition" and "setVisualMapByPosition" methods, commented.
"visualMapMap" and "map" variables add to "setNutsInBoard" method for call by reference in setter method.
parent c9fa4fcd
/**
* This class represent status of nuts, and add them to map.
* @author Rezvanian 9831029
* @version 0.0
* @version 0.1
*/
public class Nuts extends Board implements INuts {
private char color;
//This field is for "map" field in super class
private int MergePosition;
//This fields is for "visualMap" field in super class
private int x;
private int y;
......@@ -30,8 +32,21 @@ public class Nuts extends Board implements INuts {
* method in "Board" class.
*/
public void setNutsInBoard(){
//Access in version 0.1
char[][] visualMapMap = getVisualMap();
char[] map = getMap();
map[getMergePosition()] = color;
visualMapMap[getY()][getX()] = color;
setMap(map);
setVisualMap(visualMapMap);
/*
Access in version 0.0
setMapByPosition(MergePosition,color);
setVisualMapByPosition(x,y,color);
*/
}
public char getColor() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment