Advertisement
carlos1993

4Juls

May 30th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. class person {
  2.     //SOME OTHER STUFF
  3.  
  4.     /**
  5.      *  Vital function in live,
  6.      *  LOOP
  7.      *  while $this instance of person still alive
  8.      *  execute love person method which gives energy, attention, and a lot of affection to  
  9.      *  another person.
  10.      *  Then when $live runs out, the instance is destroyed and code halted.
  11.      *
  12.      * @param &Person $other_person a reference to an other person instance
  13.      * @return die() object is destroyed and program halted
  14.      * */
  15.     public function love(person &$other_person) {
  16.         //Main function loop
  17.         while ($this->isAlive()) {
  18.             $this->lovePerson($other_person);
  19.             $other_person->lovePerson($this);
  20.         }
  21.     //destroy and die
  22.         die(destroy(self));
  23.     }
  24.  
  25. }
  26.  
  27. //Carlos is born
  28. $CarlosAlaniz = new Person("09/14/1993");
  29. //Jusith is born
  30. $JudithMartinez = new Person("08/09/1994");
  31. //Connects to persons
  32. Person::meet($CarlosAlaniz, $JudithMartinez);
  33. //Check is there’s attraction between two persons
  34. if (Person::isActraction2($CarlosAlaniz, $JudithMartinez)) {
  35.     //Couple two persons
  36.     Person::couple($CarlosAlaniz, $JudithMartinez);
  37.     //set starting month at 0
  38.     $month = 0;
  39.     //Wait 3 months
  40.     while ($month < 3 || !Person::inLove($CarlosAlaniz, $JudithMartinez)) {
  41.         //wait 1 month
  42.         pause(60 * 30 * 1);
  43.         $month++;
  44.     }
  45.     //If loop broke before 3 months we take that couple is inlove
  46.     if ($month < 3) {
  47.         //Starts Love Loop on first argument.
  48.         Person::love($CarlosAlaniz, $JudithMartinez); //We are here...
  49.     // TO DO: WRITE REST OF LIVE... with you :)
  50.     } else {
  51.         //Break up couple, not enough attracticion
  52.         Person::breakUp($CarlosAlaniz, $JudithMartinez);
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement