Esempio n. 1
0
 async def obs_move_camera(self, position: Union[Unit, Units, Point2,
                                                 Point3]):
     """ Moves observer camera to the target 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(obs_action=sc_pb.RequestObserverAction(actions=[
         sc_pb.ObserverAction(camera_move=sc_pb.ActionObserverCameraMove(
             world_pos=common_pb.Point2D(x=position.x, y=position.y)))
     ]))
Esempio n. 2
0
    async def obs_move_camera(self, position: Union[Unit, Units, Point2,
                                                    Point3]):
        """Moves observer camera to the target position. Only works when observing (e.g. watching the replay).

        :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(obs_action=sc_pb.RequestObserverAction(actions=[
            sc_pb.ObserverAction(camera_move=sc_pb.ActionObserverCameraMove(
                world_pos=position.as_Point2D))
        ]))