public JsonResult ShakeTodayDish(ShakeParam param) { param.NearDistance = 1000; //筛选附近店铺 Result <IList <Shop> > dishresult = ServiceObjectContainer.Get <IShakeService>().ShakeNearShops(param); return(Json(dishresult)); }
public JsonResult ShakeNearShop(ShakeParam param) { param.NearDistance = base.SearchDistance; //存放当前定位 HttpContext.Session["Position"] = string.Format("{0},{1}", param.Longitude, param.Latitude); //筛选附近店铺 Result <IList <Shop> > shoplist = ServiceObjectContainer.Get <IShakeService>().ShakeNearShops(param); return(Json(shoplist, JsonRequestBehavior.AllowGet)); }
public override void Shake(ShakeParam param) { if (param.shakeType == CameraShakeType.eCST_UpDown || param.shakeType == CameraShakeType.eCST_All) { Reset(true, param.shakeDistanceScale); } else { Reset(false); } }
public override void Shake(ShakeParam param) { if (param != null) { if (param.shakeType == CameraShakeType.eCST_ForBackward || param.shakeType == CameraShakeType.eCST_All) { Reset(true, param.shakeDistanceScale); } else { Reset(false); } } }
public override void Shake(ShakeParam param) { if (param != null) { if (param.shakeType == CameraShakeType.eCST_Horizontal || param.shakeType == CameraShakeType.eCST_All) { Reset(true, param.shakeDistanceScale); Vector3 objForward = param.transParam.forward; convertVec = Quaternion.Inverse(parentTrans.rotation) * objForward; convertVec.Normalize(); } else { Reset(false); } } }
public void ScheduleShake(float delay, float offset, float duration) { if (!this.enabled) { this.enabled = true; } var param = new ShakeParam() { delay = delay, offset = offset, duration = duration }; m_Shakes.Add(param); m_Shakes.Sort(CompareShakeParam); }
/// <summary> /// 筛选附近店铺 /// </summary> /// <param name="param"></param> /// <returns></returns> Result <IList <Shop> > IShakeService.ShakeNearShops(ShakeParam param) { Result <IList <Shop> > result = new Result <IList <Shop> >() { Data = new List <Shop>(), Status = true, Message = "筛选附近店铺成功", StatusCode = "SNS000" }; //1.根据搜索距离、当前点经纬度 进行拓展范围 // 拓展范围方案: // 根据当前经纬度为原点,距离为远点直线距离拓展 II III 象限 // 距离单位按米计算,获得左下 右上远点坐标,确定一个矩形 //2.根据拓展的范围条件搜索符合条件的店铺 try { //获取左下角坐标 第三象限 角度225度 Position southwest = PositionUtils.CaculateFarawayPosition(new Position() { Longitude = param.Longitude, Latitude = param.Latitude }, param.NearDistance, 225); //获取右上角坐标 第一象限 角度45度 Position northeast = PositionUtils.CaculateFarawayPosition(new Position() { Longitude = param.Longitude, Latitude = param.Latitude }, param.NearDistance, 45); IList <Shop> list = DBConnectionManager.Instance.Reader.Select <Shop>(new ShakeNearShopSpefication(southwest, northeast).Satifasy()); result.Data = list; } catch (Exception ex) { result.Status = false; result.Message = "筛选附近店铺异常," + ex.Message; result.StatusCode = "SNS001"; //记录日志 LoggerUtils.LogIn(LoggerUtils.ColectExceptionMessage(ex, "At service:ShakeNearShops() .ShakeService"), LogType.ErrorLog); } return(result); }
Result <Dish> IShakeService.ShakeDish(ShakeParam param) { Result <Dish> result = new Result <Dish>() { Status = true, Message = "筛选单品信息成功" }; try { } catch (Exception ex) { result.Status = false; result.Message = "筛选单出错:" + ex.Message; result.StatusCode = "Shake000"; } return(result); }
public ActionResult Index() { //获取用户数据 ViewBag.Account = base.CurrentAccount; //获取当前定位 Position position = base.CurrentPosition; //筛选附近店铺 ShakeParam param = new ShakeParam() { Longitude = position.Longitude, Latitude = position.Latitude, NearDistance = base.SearchDistance }; Result <IList <Shop> > shoplist = ServiceObjectContainer.Get <IShakeService>().ShakeNearShops(param); ViewBag.NearShop = shoplist.Data; return(View()); }
private void Update() { if (m_DeltaTime > 0 && m_Shakes.Count > 0) { ShakeParam param = m_Shakes[0]; // shakeDelay可以等于0 if (param.delay <= 0 && param.duration > 0) { cachedTransform.localPosition = originPosition + Random.onUnitSphere * param.offset; } for (int i = 0; i < m_Shakes.Count;) { var shake = m_Shakes[i]; if (shake.delay <= 0) { shake.duration -= m_DeltaTime; } else { shake.delay -= m_DeltaTime; } if (shake.duration > 0) { m_Shakes[i++] = shake; } else { m_Shakes.RemoveAt(i); } } } else { cachedTransform.localPosition = originPosition; this.enabled = false; } }
public override void Shake(ShakeParam param) { if (param != null) { if (param.shakeType == CameraShakeType.eCST_Quadrant || param.shakeType == CameraShakeType.eCST_All) { Reset(true, param.shakeDistanceScale); Vector3 objForward = param.transParam.forward; convertVec = Quaternion.Inverse(parentTrans.rotation) * objForward; Vector3 vecYZ = Vector3.forward + Vector3.up; vecYZ.Normalize(); Vector3 vexX = Vector3.right; if (convertVec.x > 0 && convertVec.y <= 0) { vecYZ *= -1.0f; } else if (convertVec.x <= 0 && convertVec.y < 0) { vecYZ *= -1.0f; vexX *= -1.0f; } else if (convertVec.x < 0 && convertVec.y >= 0) { vexX *= -1.0f; } convertVec = vecYZ + vexX; convertVec.Normalize(); } else { Reset(false); } } }
public abstract void Shake(ShakeParam param);
private int CompareShakeParam(ShakeParam x, ShakeParam y) { return(Mathf.RoundToInt((y.offset - x.offset) * 10000)); }