コード例 #1
0
 //completes the event after the correct amount of turns has been waited after making a decision
 public void GameEventCheckIfCompleted(GameEvent gameEvent, MapRegion region)
 {
     if (gameEvent.isActive && ((gameEvent.pickedChoiceStartMonth + gameEvent.eventDuration[gameEvent.pickedChoiceNumber] + gameEvent.pickedChoiceStartYear * 12) == (currentMonth + currentYear * 12)))
     {
         AddCompletedEventToReports(region, gameEvent);
         region.CompleteEvent(gameEvent, this);
     }
 }
コード例 #2
0
    public void SetPickedChoice(int i, Game game, MapRegion region)
    {
        pickedChoiceNumber     = i;
        pickedChoiceStartYear  = game.currentYear;
        pickedChoiceStartMonth = game.currentMonth;
        isIdle        = false;
        idleTurnsLeft = 0;
        isActive      = true;

        if (!ApplicationModel.multiplayer || isOwnEvent)
        {
            game.gameStatistics.ModifyMoney(afterInvestmentEventChoiceMoneyCost[pickedChoiceNumber], false);
        }

        EventManager.CallDestroySprite(this);

        if (eventDuration[pickedChoiceNumber] == 0)
        {
            game.AddCompletedEventToReports(region, this);
            region.CompleteEvent(this, game);
        }
    }