added a win check in cube, added a getter method in unit