Beispiel #1
0
        public async Task SetAvailabilityAsync(long trainerId, TrainerStatus trainerStatus)
        {
            var trainer = await _appContext.Trainers.FirstOrDefaultAsync(i => i.UserId == trainerId);

            if (trainer == null)
            {
                throw new AppErrorException(ErrorCode.TrainerNotFound);
            }

            trainer.Status = trainerStatus;

            await _appContext.SaveChangesAsync();
        }
Beispiel #2
0
 public void ShowStats()
 {
     if (this.StatusPanel != null)
     {
         PokemonStatus pokeStatus = this.StatusPanel.GetComponent <PokemonStatus>();
         if (pokeStatus == null)
         {
             TrainerStatus trainerStatus = this.StatusPanel.GetComponent <TrainerStatus>();
             if (trainerStatus != null)
             {
                 trainerStatus.Enable();
             }
         }
         else
         {
             pokeStatus.Enable();
         }
     }
 }