示例#1
0
文件: Forest.php 项目: Dever4eg/game
 public function Chop()
 {
     //Увеличеваем дерево на складе на 1
     $stock = Stock::FindByColumn('login', Auth::GetLogin());
     $stock->wood += 1;
     $stock->save();
     if ($this->height != 1) {
         $this->height -= 1;
         $this->state = 'chopping';
         $this->save();
     } else {
         $this->height = null;
         $this->state = 'find';
         $this->found = false;
         $this->save();
     }
 }
示例#2
0
文件: Game.php 项目: Dever4eg/game
 public function ActionStock()
 {
     $stock = Stock::FindByColumn('login', Auth::GetLogin());
     $this->view->stock = $stock;
     $this->view->display('Game/stock');
 }