public GameEventUserValue(long characterId, GameEventUserValueType type, string eventValue, int eventId, long expirationTimestamp) { CharacterId = characterId; EventType = type; EventValue = eventValue; EventId = eventId; ExpirationTimestamp = expirationTimestamp; Id = DatabaseManager.GameEventUserValue.Insert(this); }
public GameEventUserValue(long id, long characterId, GameEventUserValueType type, string eventValue, int eventId, long expirationTimestamp) { Id = id; CharacterId = characterId; EventType = type; EventValue = eventValue; EventId = eventId; ExpirationTimestamp = expirationTimestamp; }
public static GameEventUserValue GetUserValue(Player player, int eventId, long expirationTimestamp, GameEventUserValueType type) { GameEventUserValue userValue = player.EventUserValues.FirstOrDefault(x => x.EventId == eventId && x.EventType == type); if (userValue is null) { userValue = new(player.CharacterId, type, "", eventId, expirationTimestamp); player.EventUserValues.Add(userValue); } return(userValue); }