Example #1
0
        public PetVital Rebuild(PetMetric petMetric, SpeciesVital animalVital, SpeciesCareAction speciesCareAction)
        {
            //This will recalculate the health based on last time interacted with. We then add the positive affect of the interaction
            var oldVital = Build(petMetric, animalVital);

            //Todo - straight return, this is just for debug
            var newVital = new PetVital()
            {
                Health                     = RecalculateMetric(oldVital.Health, petMetric, speciesCareAction), //We recalculate this
                LastTimeCaredFor           = DateTime.UtcNow,                                                  //Gets refreshed
                TimeNeglectedFor           = TimeSpan.FromSeconds(1),
                HealthDeclineDuringNeglect = 0,                                                                //No decline yet
                VitalName                  = animalVital.Name,
                VitalStats                 = animalVital,
                PetVitalId                 = animalVital.VitalId,
                PetId = petMetric.PetId
            };

            return(newVital);
        }
Example #2
0
 public static PetMetric ToNewPetMetricModel(this PetVital petVital)
 {
     return(new PetMetric(petVital.PetId, petVital.PetVitalId, petVital.Health, petVital.LastTimeCaredFor));
 }