コード例 #1
0
 async def move_camera(self, position: Union[Unit, Point2, Point3]):
     """ Moves camera to the target position """
     assert isinstance(position, (Unit, Point2, Point3))
     if isinstance(position, Unit):
         position = position.position
     await self._execute(action=sc_pb.RequestAction(action=[
         sc_pb.Action(action_raw=raw_pb.ActionRaw(
             camera_move=raw_pb.ActionRawCameraMove(
                 center_world_space=common_pb.Point(x=position.x,
                                                    y=position.y))))
     ]))
コード例 #2
0
ファイル: client.py プロジェクト: AlexanderKomi/python-sc2
    async def move_camera(self, position: Union[Unit, Units, Point2, Point3]):
        """Moves camera to the target position

        :param position:"""
        assert isinstance(position, (Unit, Units, Point2, Point3))
        if isinstance(position, Units):
            position = position.center
        if isinstance(position, Unit):
            position = position.position
        await self._execute(action=sc_pb.RequestAction(actions=[
            sc_pb.Action(action_raw=raw_pb.ActionRaw(
                camera_move=raw_pb.ActionRawCameraMove(
                    center_world_space=position.to3.as_Point)))
        ]))