public Task CompleteTask(Task task)
 {
     task.Finished = true;
     
     _dbSet.Attach(task);
     _dbContext.Entry(task).State = EntityState.Modified;
     return task;
 }
Exemple #2
0
 public int RegisterMatchCommand(int matchID)
 {
     if (_taskRepository.DoesExist(matchID, TaskTypeEnum.FindMatch)) return -1;
     var task = new Task
     {
         RequestID = matchID,
         TaskType = TaskTypeEnum.FindMatch,
         Priority = TaskPriorityEnum.High
     };
     _taskRepository.Add(task);
     return _taskRepository.TaskCount(TaskPriorityEnum.High)+1;
 }
Exemple #3
0
 public int RegisterMatchListCommand(int playerID, int? heroID, int? enemyHeroID, int? matchCount)
 {
     //if (_taskRepository.DoesExist(playerID, heroID, enemyHeroID, matchCount, TaskTypeEnum.FindMatch)) return -1;
     var task = new Task
     {
         RequestID = playerID,
         HeroID = heroID,
         EnemyHeroID = enemyHeroID,
         Count = matchCount,
         TaskType = TaskTypeEnum.FindMatchList,
         Priority = TaskPriorityEnum.VeryHigh
     };
     _taskRepository.Add(task);
     return _taskRepository.TaskCount(TaskPriorityEnum.Normal) + matchCount ?? 1;
 }
 public void AddTask(Task task)
 {
     AddTasks(new []{ task });
 }