Пример #1
0
 public void Delete(StandingInfo info)
 {
     Db.Query().CommandText("delete standings where source=@sourceEID and target=@targetEID")
     .SetParameter("@sourceEID", info.sourceEID)
     .SetParameter("@targetEID", info.targetEID)
     .ExecuteNonQuery();
 }
Пример #2
0
 public void InsertOrUpdate(StandingInfo info)
 {
     Db.Query().CommandText("setStanding")
     .SetParameter("@source", info.sourceEID)
     .SetParameter("@target", info.targetEID)
     .SetParameter("@standing", info.standing)
     .ExecuteNonQuery().ThrowIfEqual(0, ErrorCodes.SQLExecutionError);
 }
Пример #3
0
        public void SetStanding(long sourceEID, long targetEID, double standing)
        {
            standing = standing.Clamp(-10.0, 10.0);
            var info = new StandingInfo(sourceEID, targetEID, standing);

            if (Math.Abs(standing) > double.Epsilon)
            {
                _standingRepository.InsertOrUpdate(info);
            }
            else
            {
                _standingRepository.Delete(info);
            }

            GetOrAddStandingHolder(sourceEID).SetStanding(targetEID, standing);
            SendStandingDataChangedToHosts(info);
        }
Пример #4
0
 private static void SendStandingDataChangedToHosts(StandingInfo info)
 {
 }