Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class person {
- //SOME OTHER STUFF
- /**
- * Vital function in live,
- * LOOP
- * while $this instance of person still alive
- * execute love person method which gives energy, attention, and a lot of affection to
- * another person.
- * Then when $live runs out, the instance is destroyed and code halted.
- *
- * @param &Person $other_person a reference to an other person instance
- * @return die() object is destroyed and program halted
- * */
- public function love(person &$other_person) {
- //Main function loop
- while ($this->isAlive()) {
- $this->lovePerson($other_person);
- $other_person->lovePerson($this);
- }
- //destroy and die
- die(destroy(self));
- }
- }
- //Carlos is born
- $CarlosAlaniz = new Person("09/14/1993");
- //Jusith is born
- $JudithMartinez = new Person("08/09/1994");
- //Connects to persons
- Person::meet($CarlosAlaniz, $JudithMartinez);
- //Check is there’s attraction between two persons
- if (Person::isActraction2($CarlosAlaniz, $JudithMartinez)) {
- //Couple two persons
- Person::couple($CarlosAlaniz, $JudithMartinez);
- //set starting month at 0
- $month = 0;
- //Wait 3 months
- while ($month < 3 || !Person::inLove($CarlosAlaniz, $JudithMartinez)) {
- //wait 1 month
- pause(60 * 30 * 1);
- $month++;
- }
- //If loop broke before 3 months we take that couple is inlove
- if ($month < 3) {
- //Starts Love Loop on first argument.
- Person::love($CarlosAlaniz, $JudithMartinez); //We are here...
- // TO DO: WRITE REST OF LIVE... with you :)
- } else {
- //Break up couple, not enough attracticion
- Person::breakUp($CarlosAlaniz, $JudithMartinez);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement