Beispiel #1
0
    def __init__(self, init_count, his_count, init_level=2):
        self.init_count = init_count
        self.resolve_method = "F2CP"
        self.right_panel = "library"

        self.gameExit = False
        self.current_level = init_level
        self.dk_count = 0
        self.dk_time = 0

        self.timing_started = False
        self.timing_start = 0.0
        self.timing_stop = 0.0

        self.comparing = False
        #初始化数据模型,判断mycube.clp文件在不在,
        #如果在,就读这个文件初始化
        if os.path.exists("./mycube.clp"):
            my_cube = cubeModel.Cube("./mycube.clp")
        else:
            my_cube = cubeModel.Cube()
        self.my_playground = cubePlayground.CubePlayground(my_cube)
        self.my_snapshot = cubeSnapshot.CubeSnapshot(my_cube)
        self.my_tutorial = cubeTutorial.CubeTutorial()
        self.my_library = cubeLibrary.CubeLibrary(my_cube, init_level)
Beispiel #2
0
 def showLibBelowLevel3(self):
     if self.total == 0:
         return
     self.legends = []
     file = self.snapshots_dir + self.snapshots[self.current - 1][0]
     cube = cubeModel.Cube(file)
     self.my_cube_3d = cubeLegendF2L.CubeLegendF2L(cube, width, height, fov,
                                                   distance, adj_x, adj_y)
     self.my_cube_3d.buildFaces()
     self.my_cube_3d.setLBDPos([(180, -70), (480, -70), (160, 260)])
     self.my_cube_3d.displayContent()
     self.legends.append(self.my_cube_3d)
     self.current_legend = 0
     Panel.printLeft(u"选择了第" + str(self.current) + "份快照")
Beispiel #3
0
 def showLibLevel4(self):
     if self.total == 0:
         return
     Panel.clearRight()
     start = (self.current - 1) * 12
     end = start + 12
     if end > len(self.snapshots):
         end = len(self.snapshots)
     self.legends = []
     for i in range(start, end):
         file_no = +i
         file = self.snapshots_dir + self.snapshots[i][0]
         cube = cubeModel.Cube(file)
         m, r = divmod(i - start, 3)
         cube_3d = cubeLegendPLL.CubeLegendPLL(cube, width, height, fov, 20,
                                               650 + r * 180,
                                               -120 + m * 150)
         cube_3d.buildFaces()
         cube_3d.displayContent()
         self.legends.append(cube_3d)
Beispiel #4
0
 def reset(self, dumy):
     my_cube = cubeModel.Cube()
     self.my_playground = cubePlayground.CubePlayground(my_cube)
     self.my_playground.displayContent()
     self.my_snapshot = cubeSnapshot.CubeSnapshot(my_cube)