public int uniformCmd(boolean eqSkip) {Iterator<Cell> i = cells.values().iterator();int ret = -1;uniformCnt = 1;uniformSkip = 0;for (; i.hasNext();) {Cell c = i.next();if (c.ref >= 0) {return -1;}if (c.cmd >= 0) {if (ret < 0) {ret = c.cmd;uniformSkip = c.skip;} else if (ret == c.cmd) {if (eqSkip) {if (uniformSkip == c.skip) {uniformCnt++;} else {return -1;}} else {uniformCnt++;}} else {return -1;}}}return ret;}

public int uniformCmd ( boolean eqSkip ) { Iterator < Cell > i = cells . values ( ) . iterator ( ) ; int ret = - 1 ; uniformCnt = 1 ; uniformSkip = 0 ; for ( ; i . hasNext ( ) ; ) { Cell c = i . next ( ) ; if ( c . ref >= 0 ) { return - 1 ; } if ( c . cmd >= 0 ) { if ( ret < 0 ) { ret = c . cmd ; uniformSkip = c . skip ; } else if ( ret == c . cmd ) { if ( eqSkip ) { if ( uniformSkip == c . skip ) { uniformCnt ++ ; } else { return - 1 ; } } else { uniformCnt ++ ; } } else { return - 1 ; } } } return ret ; }
public int UniformCmd(bool eqSkip){int ret = -1;uniformCnt = 1;uniformSkip = 0;foreach (Cell c in cells.Values){if (c.@ref >= 0){return -1;}if (c.cmd >= 0){if (ret < 0){ret = c.cmd;uniformSkip = c.skip;}else if (ret == c.cmd){if (eqSkip){if (uniformSkip == c.skip){uniformCnt++;}else{return -1;}}else{uniformCnt++;}}else{return -1;}}}return ret;}
