2024-08-24 21:18:15 +02:00
|
|
|
/*
|
|
|
|
* NewTurnProcessor.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../lib/constants/EntityIdentifiers.h"
|
2024-08-25 18:22:49 +02:00
|
|
|
#include "../../lib/constants/Enumerations.h"
|
2024-08-25 21:25:40 +02:00
|
|
|
#include "../../lib/gameState/RumorState.h"
|
2024-08-24 21:18:15 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
class CGTownInstance;
|
|
|
|
class ResourceSet;
|
2024-08-25 18:22:49 +02:00
|
|
|
struct SetAvailableCreatures;
|
2024-08-25 23:35:32 +02:00
|
|
|
struct SetMovePoints;
|
|
|
|
struct SetMana;
|
2024-08-26 15:49:50 +02:00
|
|
|
struct InfoWindow;
|
|
|
|
struct NewTurn;
|
2024-08-24 21:18:15 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
|
|
|
class CGameHandler;
|
|
|
|
|
|
|
|
class NewTurnProcessor : boost::noncopyable
|
|
|
|
{
|
|
|
|
CGameHandler * gameHandler;
|
|
|
|
|
2024-08-25 23:35:32 +02:00
|
|
|
std::vector<SetMana> updateHeroesManaPoints();
|
|
|
|
std::vector<SetMovePoints> updateHeroesMovementPoints();
|
|
|
|
|
2024-08-24 21:18:15 +02:00
|
|
|
ResourceSet generatePlayerIncome(PlayerColor playerID, bool newWeek);
|
2024-08-25 18:22:49 +02:00
|
|
|
SetAvailableCreatures generateTownGrowth(const CGTownInstance * town, EWeekType weekType, CreatureID creatureWeek, bool firstDay);
|
2024-08-25 21:25:40 +02:00
|
|
|
RumorState pickNewRumor();
|
2024-08-26 15:49:50 +02:00
|
|
|
InfoWindow createInfoWindow(EWeekType weekType, CreatureID creatureWeek, bool newMonth);
|
2024-08-25 21:39:34 +02:00
|
|
|
std::tuple<EWeekType, CreatureID> pickWeekType(bool newMonth);
|
2024-08-24 21:18:15 +02:00
|
|
|
|
2024-08-26 15:49:50 +02:00
|
|
|
NewTurn generateNewTurnPack();
|
2024-08-26 18:02:38 +02:00
|
|
|
void handleTimeEvents(PlayerColor player);
|
|
|
|
void handleTownEvents(const CGTownInstance *town);
|
2024-08-26 15:49:50 +02:00
|
|
|
|
2024-08-29 16:19:23 +02:00
|
|
|
void updateNeutralTownGarrison(const CGTownInstance * t, int currentWeek) const;
|
|
|
|
|
2024-08-26 15:49:50 +02:00
|
|
|
public:
|
|
|
|
NewTurnProcessor(CGameHandler * gameHandler);
|
|
|
|
|
|
|
|
void onNewTurn();
|
2024-08-24 21:18:15 +02:00
|
|
|
void onPlayerTurnStarted(PlayerColor color);
|
|
|
|
void onPlayerTurnEnded(PlayerColor color);
|
|
|
|
};
|