Example #1
0
    /*
     * public static bool trySoloBreed(Actor_Data actorA)
     * {
     *  //solo breeding by simulation will just flood the world with copies exponentially 1 -> 2 -> 4 -> 8
     *  Actor_BreedData A = actorA.breedData;
     *
     *  if (A.checkCanBreed() && A.gender == Actor_Gender.solo)
     *  {
     *      A.makePregnant();
     *      return true;
     *  }
     *  else return false;
     * }
     */

    public static bool tryBreed(Actor_Data actorA, Actor_Data actorB)
    {
        Actor_BreedData A = actorA.breedData;
        Actor_BreedData B = actorB.breedData;

        if (!(A.checkCanBreed() && B.checkCanBreed()))
        {
            return(false);
        }
        else if ((A.gender == Actor_Gender.female || A.gender == Actor_Gender.both) && B.gender == Actor_Gender.male)
        {
            A.makePregnant();
            B.makeCooldown();
            makeFamily(actorB, actorA);
            return(true);
        }
        else if ((B.gender == Actor_Gender.female || B.gender == Actor_Gender.both) && A.gender == Actor_Gender.male)
        {
            B.makePregnant();
            A.makeCooldown();
            makeFamily(actorA, actorB);
            return(true);
        }
        else if (B.gender == Actor_Gender.both && A.gender == Actor_Gender.both)
        {
            A.makePregnant();
            B.makePregnant();
            makeFamily(actorA, actorB);
            return(true);
        }
        else
        {
            return(false);
        }
    }
Example #2
0
    protected void init()
    {
        Alive           = true;
        region          = 0;
        birthday        = new TimeDate();
        age             = new TimeDate();
        actorValues     = new List <ActorValue>();
        personalityData = new Actor_Personality(); //TODO: this can be optional at some point
        breedData       = new Actor_BreedData();   //TODO: this can be optional at some point

        //DEBUG
        initToDefault();
        setRandomActor();
    }