Exemplo n.º 1
0
        public override void _Ready()
        {
            _reproductionController        = GetNode <ReproductionController>("ReproductionController");
            _needsController               = GetNode <NeedsController>("NeedsController");
            _reproductionController.Gender = _gender;
            _reproductionController.Connect("HadSex", this, nameof(ReproductionControllerOnHadSex));

            _reproductionController.Connect("Birth", this, nameof(ActorBirth));
            _needsController.Connect("SexWith", this, nameof(NeedsControllerOnSexWith));
        }
 public void Sex(ReproductionController partner)
 {
     if (Gender.CanHaveSexWith(partner.Gender) && !_isPregnant)
     {
         EmitSignal(nameof(HadSex));
         if (Gender == Gender.Female)
         {
             _isPregnant = true;
             _estimatedBirthTimer.Start(_pregnancyTime);
         }
     }
 }