コード例 #1
0
ファイル: DogPet.cs プロジェクト: Lechyl/Tomogachi
 public DogPet(string name)
 {
     Name            = name;
     Health          = 100;
     MaxHealth       = 100;
     MaxHunger       = 100;
     MaxHappiness    = 100;
     FallAsleepLevel = 100;
     PetAgingState   = AgingStage.Infant;
 }
コード例 #2
0
ファイル: CatPet.cs プロジェクト: Lechyl/Tomogachi
        protected override void Aging()
        {
            //according to myth a cat has 9 lives. My cat is immortal.
            int nextPetAge = ((int)PetAge + 1) % 4;

            PetAge = (AgingStage)nextPetAge;
            if (PetAge == AgingStage.Infant)
            {
                Console.WriteLine($"{Name} has been reborn with the magical symtom of 9 lives");
            }
        }