Пример #1
0
        public void Action(MainForm form)
        {
            // ----- current contentment in the park -----
            if (!contentmentAward) {
                contentment = model.persList.contenment;
                if (contentment > 90) currHighContentmentTime++;
                if (currHighContentmentTime > highContTimeInPark) {
                    contentmentAward = true;
                    ProcessNewPrize(prize_HighContentment, PrizeNotices.highContentment);
                }
            }
            else currHighContentmentTime = 0;

            // ----- propagation -----
            if (propagateOn) {
                propagation++; // is thread-safe because Action is called only from one thread
                model.MoneyAdd(- MainForm.propagatePrize);
            }
            else { propagation = Math.Max(0, propagation - 1) ;}
               // ----- researching -----
            if (researchOn) ResearchOnAction(form);
        }
Пример #2
0
 public View2(GameRecords m, MainForm form)
 {
     this.model = m;
     this.form = form;
     form.PrepareFormsStartAppearance(model.currOfferedAmus, model.currOfferedPaths, model.currOfferedOthers, model.images);
 }
Пример #3
0
 private void ResearchOnAction(MainForm form)
 {
     model.MoneyAdd(-MainForm.researchPrize);
     timeToShowNewItem--;
     if (timeToShowNewItem == 0) {
         MessageBox.Show(Notices.newRevealedItem + followingItemToReveal.name, Labels.gratulationMessBox, MessageBoxButtons.OK);
         object[] args = { followingItemToReveal, model.images[followingItemToReveal.internTypeId] };
         rvDelegate = new RevealItemDelegate(form.AddNewItemToForm);
         form.BeginInvoke(rvDelegate, args);
         LaterShownItem l;
         this.laterRevealedObjects.TryDequeue(out l);
         if (l != null) {
             timeToShowNewItem = l.timeToShow;
             followingItemToReveal = l.item;
         }
         else ProcessNewPrize(prize_NoMoreResearch, PrizeNotices.noMoreResearch);
     }
 }