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(); }
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); }
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); }
private static void SendStandingDataChangedToHosts(StandingInfo info) { }