Exemplo n.º 1
0
 public void Fitness(int id, string type)
 {
     if (type == "Pilot")
     {
         pilots.DecreaseEnergy(id, 10);
         pilots.DecreasePounds(id, 1);
         pilots.IncreasePhysicalTraining(id, 2);
         pilots.IsWorking(id);
     }
     else if (type == "Navigator")
     {
         navigators.DecreaseEnergy(id, 10);
         navigators.DecreasePounds(id, 1);
         navigators.IncreasePhysicalTraining(id, 2);
         navigators.IsWorking(id);
     }
 }
Exemplo n.º 2
0
        private async Task RepairParts(Parts typeParts, IRallyPilotsServices rallyPilots, int idPilot,
                                       IRallyNavigatorsServices rallyNavigators, int idNavigator)
        {
            var energy = 100 - typeParts.Strength;

            typeParts.Strength = 100;
            rallyPilots.IsWorking(idPilot);
            rallyPilots.DecreaseEnergy(idPilot, Decimal.ToInt32(energy));
            rallyNavigators.IsWorking(idNavigator);
            rallyNavigators.DecreaseEnergy(idNavigator, Decimal.ToInt32(energy));
            await dbContext.SaveChangesAsync();
        }