コード例 #1
0
    def testComputeCenterPointMid(self):

        startPoint: ArcadePoint = ArcadePoint(x=0, y=0)
        endPoint:   ArcadePoint = ArcadePoint(x=400, y=400)

        midPoint: ArcadePoint = Computer.computeCenterPoint(start=startPoint, end=endPoint)

        self.logger.debug(f'{startPoint=} {endPoint=} {midPoint=}')

        expectedPoint: ArcadePoint = ArcadePoint(x=200, y=200)
        self.assertEqual(expectedPoint, midPoint, 'Mid Center point does not match')
コード例 #2
0
    def testComputeCenterPointLong(self):

        startPoint: ArcadePoint = ArcadePoint(x=10, y=10)
        endPoint:   ArcadePoint = ArcadePoint(x=SCREEN_HEIGHT-10, y=QUADRANT_GRID_WIDTH-10)

        midPoint: ArcadePoint = Computer.computeCenterPoint(start=startPoint, end=endPoint)

        self.logger.debug(f'{startPoint=} {endPoint=} {midPoint=}')

        expectedPoint: ArcadePoint = ArcadePoint(x=415, y=320)
        self.assertEqual(expectedPoint, midPoint, 'Long Center point does not match')