Esempio n. 1
0
 async def move_camera_spatial(self, position: Union[Point2, Point3]):
     """ Moves camera to the target position using the spatial aciton interface """
     from s2clientprotocol import spatial_pb2 as spatial_pb
     assert isinstance(position, (Point2, Point3))
     action = sc_pb.Action(action_render=spatial_pb.ActionSpatial(
         camera_move=spatial_pb.ActionSpatialCameraMove(
             center_minimap=common_pb.PointI(x=position.x, y=position.y))))
     await self._execute(action=sc_pb.RequestAction(actions=[action]))
Esempio n. 2
0
    async def move_camera_spatial(self, position: Union[Point2, Point3]):
        """Moves camera to the target position using the spatial aciton interface

        :param position:"""
        assert isinstance(position, (Point2, Point3))
        action = sc_pb.Action(action_render=spatial_pb.ActionSpatial(
            camera_move=spatial_pb.ActionSpatialCameraMove(
                center_minimap=position.as_PointI)))
        await self._execute(action=sc_pb.RequestAction(actions=[action]))
Esempio n. 3
0
        def get_action_spatial(ability_id):
            target_point = common_pb2.PointI()
            target_point.x = 0
            target_point.y = 0

            action_spatial_unit_command = spatial_pb2.ActionSpatialUnitCommand(target_minimap_coord=target_point)
            action_spatial_unit_command.ability_id = ability_id

            action_spatial = spatial_pb2.ActionSpatial(unit_command=action_spatial_unit_command)
            action = sc2api_pb2.Action(action_feature_layer=action_spatial)
            return action