Advertisement
Hsilamot

Fiestón

Sep 15th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. class Fiestón {
  3.     public $restroom_status = 0;
  4.     public $restroom_refresher_shots_available = 1000;
  5.     public $restroom_stink = 0;
  6.     public function restroom($person) {
  7.         if ($this->restroom_status==0) {
  8.             $this->restroom_status = 1;
  9.             while ($person->bladder>0) {
  10.                 sleep(1);
  11.             }
  12.             while ($person->bowels>0) {
  13.                 sleep(1);
  14.             }
  15.             $person->exit_premises(true);
  16.             $this->restroom_status = 1;
  17.             $this->restroom_refresh();
  18.             return true;
  19.         } else {
  20.             return OCCUPIED_TRY_LATER;
  21.         }
  22.     }
  23.     public function restroom_refresh() {
  24.         if ($this->restroom_refresher_shots_available>0) {
  25.             $this->restroom_refresher_shots_available--;
  26.             return true;
  27.         } else {
  28.             $this->restroom_stink++;
  29.             return false;
  30.         }
  31.     }
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement