Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. bool Building::startProduction(Account *account, const uint32_t &start_time, Human *worker) {
  2.     if (!account)
  3.         return false;
  4.  
  5.     EventAction &event = setParams().setEvent();
  6.     event.setType(EventAction::PRODUCTION_COMPLETE);
  7.     event.setStart(start_time);
  8.     event.setFinish(start_time + getProcessTime(account, start_time));
  9.  
  10.     if (!Dicts::quests().updateEvent(account, event.getType()))
  11.         return false;
  12.  
  13.     if (!changeState(account, PRODUCTING))
  14.         return false;
  15.  
  16.     if (worker)
  17.         setWorker(worker);
  18.  
  19.     // Если это Exploration объект - выставляем lock_after
  20.     if (const Interactive *interactive = Dicts::getInteractive(*this)) {
  21.         Aspects::Exploration exploration_aspect;
  22.         if (interactive->findAspect(exploration_aspect)) {
  23.             auto iteration = exploration_aspect.findIteration(getParams().getExploreStage());
  24.             if (iteration && iteration->isNeedLock())
  25.                 setFlags().setLockAfter(true);
  26.         }
  27.     }
  28.  
  29.     return true;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement