C# 클래스 ActivEarth.DAO.ChallengeDAO

파일 보기 프로젝트 열기: mlcamilli/ActivEarth

공개 메소드들

메소드 설명
CreateInitializationEntry ( int challengeId, int userId, float value ) : bool

Creates a new user initialization entry for a challenge.

CreateNewChallenge ( Challenge challenge ) : int

Saves a challenge as a new entry in the DB.

GenerateRandomChallenges ( ChallengeType type, int count ) : List

Creates a number of random challenges by reading in from the Challenge_Definitions SQL table.

GetActiveChallenges ( int userId ) : List

Retrieves all currently active challenges.

GetActiveDailyChallenges ( int userId ) : List

Retrieves all currently active daily challenges.

GetActiveMonthlyChallenges ( int userId ) : List

Retrieves all currently active monthly challenges.

GetActivePersistentChallenges ( int userId ) : List

Retrieves all currently active persistent challenges.

GetActiveWeeklyChallenges ( int userId ) : List

Retrieves all currently active weekly challenges.

GetAllChallenges ( ) : List

Retrieves all challenges in the archive.

GetChallengeFromChallengeId ( int challengeId, int userId ) : Challenge

Retrieves a Challenge from the DB based on its ID.

GetInitializationValue ( int challengeId, int userId ) : float

Returns the stored initial value for a user in a particular challenge.

GetStatisticFromChallengeId ( int challengeId ) : Statistic

Lookup for the statistic being tracked by a specific challenge.

RemoveInitializationValues ( int challengeId ) : bool

Removes all initialization entries for a challenge (to clean up DB upon challenge expiration).

UpdateChallenge ( Challenge challenge ) : bool

Updates an existing Challenge in the DB.

비공개 메소드들

메소드 설명
GetActiveChallengesByDuration ( int days, int userId ) : List

Retrieves all currently active challenges of a given length.

메소드 상세

CreateInitializationEntry() 공개 정적인 메소드

Creates a new user initialization entry for a challenge.
public static CreateInitializationEntry ( int challengeId, int userId, float value ) : bool
challengeId int ID of the challenge the user is participating in.
userId int ID of the user being initialized.
value float Current value of the relevant statistic for the challenge.
리턴 bool

CreateNewChallenge() 공개 정적인 메소드

Saves a challenge as a new entry in the DB.
public static CreateNewChallenge ( Challenge challenge ) : int
challenge ActivEarth.Objects.Competition.Challenges.Challenge Challenge object to add to the DB.
리턴 int

GenerateRandomChallenges() 공개 정적인 메소드

Creates a number of random challenges by reading in from the Challenge_Definitions SQL table.
public static GenerateRandomChallenges ( ChallengeType type, int count ) : List
type ChallengeType Type of challenges desired (Daily/Weekly/Monthly).
count int Number of challenges needing to be created.
리턴 List

GetActiveChallenges() 공개 정적인 메소드

Retrieves all currently active challenges.
public static GetActiveChallenges ( int userId ) : List
userId int Optional. UserID to load challenge progress from.
리턴 List

GetActiveDailyChallenges() 공개 정적인 메소드

Retrieves all currently active daily challenges.
public static GetActiveDailyChallenges ( int userId ) : List
userId int Optional. UserID to load challenge progress from.
리턴 List

GetActiveMonthlyChallenges() 공개 정적인 메소드

Retrieves all currently active monthly challenges.
public static GetActiveMonthlyChallenges ( int userId ) : List
userId int Optional. UserID to load challenge progress from.
리턴 List

GetActivePersistentChallenges() 공개 정적인 메소드

Retrieves all currently active persistent challenges.
public static GetActivePersistentChallenges ( int userId ) : List
userId int
리턴 List

GetActiveWeeklyChallenges() 공개 정적인 메소드

Retrieves all currently active weekly challenges.
public static GetActiveWeeklyChallenges ( int userId ) : List
userId int Optional. UserID to load challenge progress from.
리턴 List

GetAllChallenges() 공개 정적인 메소드

Retrieves all challenges in the archive.
public static GetAllChallenges ( ) : List
리턴 List

GetChallengeFromChallengeId() 공개 정적인 메소드

Retrieves a Challenge from the DB based on its ID.
public static GetChallengeFromChallengeId ( int challengeId, int userId ) : Challenge
challengeId int Identifier of the challenge to retrieve.
userId int Optional. UserID to load challenge progress from.
리턴 ActivEarth.Objects.Competition.Challenges.Challenge

GetInitializationValue() 공개 정적인 메소드

Returns the stored initial value for a user in a particular challenge.
public static GetInitializationValue ( int challengeId, int userId ) : float
challengeId int ID of the challenge to look up.
userId int ID of the user whose value shall be returned.
리턴 float

GetStatisticFromChallengeId() 공개 정적인 메소드

Lookup for the statistic being tracked by a specific challenge.
public static GetStatisticFromChallengeId ( int challengeId ) : Statistic
challengeId int ID of the challenge to query.
리턴 Statistic

RemoveInitializationValues() 공개 정적인 메소드

Removes all initialization entries for a challenge (to clean up DB upon challenge expiration).
public static RemoveInitializationValues ( int challengeId ) : bool
challengeId int ID of the challenge whose data shall be removed.
리턴 bool

UpdateChallenge() 공개 정적인 메소드

Updates an existing Challenge in the DB.
public static UpdateChallenge ( Challenge challenge ) : bool
challenge ActivEarth.Objects.Competition.Challenges.Challenge Challenge whose record needs updating.
리턴 bool