Esempio n. 1
0
 private void ApplyPoints()
 {
     m_lineRenderer.positionCount = m_points.Count;
     m_lineRenderer.startWidth    = 0;
     m_lineRenderer.endWidth      = 0.5f;
     for (int i = 0; i < m_lineRenderer.positionCount; i++)
     {
         PointRecord record = m_points[i];
         m_lineRenderer.SetPosition(i, record.pos);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 生成动态操作链接
        /// </summary>
        private static MvcHtmlString PointMessage(this HtmlHelper htmlHelper, long userId)
        {
            PointService pointService = new PointService();
            IEnumerable <PointCategory> pointCategories = pointService.GetPointCategories();

            htmlHelper.ViewData["ExperiencePoints"] = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("ExperiencePoints")).CategoryName;
            htmlHelper.ViewData["ReputationPoints"] = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("ReputationPoints")).CategoryName;
            htmlHelper.ViewData["TradePoints"]      = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("TradePoints")).CategoryName;

            PointRecord pointRecord = pointService.GetUserLastestRecord(userId);

            htmlHelper.ViewData["PointRecord"] = pointRecord;
            return(htmlHelper.DisplayForModel("PointMessage"));
        }
Esempio n. 3
0
        /// <summary>
        /// 奖励和惩罚用户
        /// </summary>
        /// <param name="user">用户</param>
        /// <param name="description">理由</param>
        /// <param name="experiencePoints">经验积分值</param>
        /// <param name="reputationPoints">威望积分值</param>
        /// <param name="tradePoints">交易积分值</param>
        /// <param name="isIncome">是否是收入</param>
        public void RewardAndPunishment(IUser user, string description, int experiencePoints, int reputationPoints, int tradePoints, bool isIncome)
        {
            //更新用户积分
            ChangePoints(user, experiencePoints, reputationPoints, tradePoints, 0, 0, 0);

            //产生积分记录
            PointRecord pointRecord = PointRecord.New();

            pointRecord.UserId = user.UserId;
            if (isIncome)
            {
                pointRecord.PointItemName = "系统奖励";
            }
            else
            {
                pointRecord.PointItemName = "系统扣除";
            }
            if (string.IsNullOrEmpty(description))
            {
                if (isIncome)
                {
                    pointRecord.Description = "系统奖励了你经验:" + experiencePoints + ",威望:" + reputationPoints + ",金币:" + tradePoints;
                }
                else
                {
                    pointRecord.Description = "系统扣除了你经验:" + -experiencePoints + ",威望:" + -reputationPoints + ",金币:" + -tradePoints;
                }
            }
            else
            {
                if (isIncome)
                {
                    pointRecord.Description = description + ",系统奖励了你经验:" + experiencePoints + ",威望:" + reputationPoints + ",金币:" + tradePoints;
                }
                else
                {
                    pointRecord.Description = description + ",系统扣除了你经验:" + -experiencePoints + ",威望:" + -reputationPoints + ",金币:" + -tradePoints;
                }
            }
            pointRecord.ExperiencePoints = experiencePoints;
            pointRecord.ReputationPoints = reputationPoints;
            pointRecord.TradePoints      = tradePoints;
            pointRecord.TradePoints2     = 0;
            pointRecord.TradePoints3     = 0;
            pointRecord.TradePoints4     = 0;
            pointRecord.IsIncome         = isIncome;
            new PointRecordRepository().Insert(pointRecord);
        }
Esempio n. 4
0
        public async Task ChangePoint(ChangePointInput input)
        {
            if (input.Amount != 0)
            {
                var vipPoint = _pointRepository.FirstOrDefault(a => a.VipId == input.VipId);
                vipPoint.VipPoint = vipPoint.VipPoint + input.Amount;
                _pointRepository.Update(vipPoint);

                PointRecord pr = new PointRecord();
                pr.Id           = Guid.NewGuid().ToString().ToUpper();
                pr.VipId        = input.VipId;
                pr.PointChange  = input.Amount;
                pr.PointExplain = input.Explain;
                pr.PosNo        = "";
                pr.AddMan       = AsyncHelper.RunSync(() => UserManager.GetUserByIdAsync((long)AbpSession.UserId)).Name;
                pr.AddTime      = DateTime.Now;
                _pointRecordRepository.Insert(pr);
            }
            else
            {
                throw new UserFriendlyException("修改数量不能等于零");
            }
        }
Esempio n. 5
0
    private void SpawnPoint()
    {
        PointRecord point = new PointRecord(m_followTarget.transform.position, m_pointPeriod);

        m_points.Add(point);
    }
Esempio n. 6
0
 public static double degreesPoint(PointRecord from, PointRecord to)
 {
     return(degrees(from.x, from.y, to.x, to.y));
 }