C# Class JustPressPlay.Models.Repositories.QuestRepository

Inheritance: Repository
Mostra file Open project: RIT-MAGIC/JustPressPlay Class Usage Examples

Public Methods

Method Description
AddQuest ( AddQuestViewModel model ) : void

Creates a new quest_template and adds it to the database

AdminEditQuest ( int id, EditQuestViewModel model ) : void

Gets the specified quest_template and updates it with any edits

ApproveUserQuest ( int questID ) : void
CheckAllUserQuestCompletion ( int questID ) : void

Checks all users for quest completion

CheckAssociatedQuestCompletion ( int achievementID, user userToCheck, List userAchievements, bool autoSave, bool achievementRevoked = false ) : void

Checks for completion of quests that have the specified achievement as a quest step

DenyUserQuest ( int questID, string reason ) : void
GetQuestState ( int id ) : int
GetQuestsForFeed ( ) : List
GetTrackedQuestsForUser ( int userID ) : IEnumerable
QuestRepository ( IUnitOfWork unitOfWork ) : System

Creates a new user repository

QuestTitleExists ( String title, int id = null ) : bool
Save ( ) : void
Track ( int id ) : System.Boolean

Tracks the specific quest for the current user

Untrack ( int id ) : System.Boolean

Untracks the specific quest for the current user

Private Methods

Method Description
AddAchievementStepsToDatabase ( IEnumerable steps ) : void

Adds the collection of quest_achievement_step(s) to the database

AddQuestTemplateToDatabase ( quest_template template ) : void

Add the quest_template to the database

CompleteQuest ( int questID, user userToCheck, int achievementID, bool autoSave ) : void
RevokeQuest ( quest_instance questInstance, int achievementID, bool autoSave ) : void

Method Details

AddQuest() public method

Creates a new quest_template and adds it to the database
public AddQuest ( AddQuestViewModel model ) : void
model JustPressPlay.ViewModels.AddQuestViewModel The AddQuestViewModel passed in from the controller
return void

AdminEditQuest() public method

Gets the specified quest_template and updates it with any edits
public AdminEditQuest ( int id, EditQuestViewModel model ) : void
id int The id of the quest_template
model JustPressPlay.ViewModels.EditQuestViewModel The EditQuestViewModel passed in from the controller
return void

ApproveUserQuest() public method

public ApproveUserQuest ( int questID ) : void
questID int
return void

CheckAllUserQuestCompletion() public method

Checks all users for quest completion
public CheckAllUserQuestCompletion ( int questID ) : void
questID int The id of the quest to check
return void

CheckAssociatedQuestCompletion() public method

Checks for completion of quests that have the specified achievement as a quest step
public CheckAssociatedQuestCompletion ( int achievementID, user userToCheck, List userAchievements, bool autoSave, bool achievementRevoked = false ) : void
achievementID int ID of the achievement
userToCheck user
userAchievements List
autoSave bool
achievementRevoked bool
return void

DenyUserQuest() public method

public DenyUserQuest ( int questID, string reason ) : void
questID int
reason string
return void

GetQuestState() public method

public GetQuestState ( int id ) : int
id int
return int

GetQuestsForFeed() public method

public GetQuestsForFeed ( ) : List
return List

GetTrackedQuestsForUser() public method

public GetTrackedQuestsForUser ( int userID ) : IEnumerable
userID int
return IEnumerable

QuestRepository() public method

Creates a new user repository
public QuestRepository ( IUnitOfWork unitOfWork ) : System
unitOfWork IUnitOfWork The unit of work that created this repository
return System

QuestTitleExists() public method

public QuestTitleExists ( String title, int id = null ) : bool
title String
id int
return bool

Save() public method

public Save ( ) : void
return void

Track() public method

Tracks the specific quest for the current user
public Track ( int id ) : System.Boolean
id int The id of the quest
return System.Boolean

Untrack() public method

Untracks the specific quest for the current user
public Untrack ( int id ) : System.Boolean
id int The id of the quest
return System.Boolean