89 lines
3.9 KiB
C++
89 lines
3.9 KiB
C++
// This file is part of c-evo-evo.
|
|
//
|
|
// This software is governed by the CeCILL license under French law and
|
|
// abiding by the rules of distribution of free software. You can use,
|
|
// modify and/or redistribute the software under the terms of the CeCILL
|
|
// license as circulated by CEA, CNRS and INRIA at the following URL
|
|
// "http://www.cecill.info".
|
|
//
|
|
// As a counterpart to the access to the source code and rights to copy,
|
|
// modify and redistribute granted by the license, users are provided only
|
|
// with a limited warranty and the software's author, the holder of the
|
|
// economic rights, and the successive licensors have only limited
|
|
// liability.
|
|
//
|
|
// In this respect, the user's attention is drawn to the risks associated
|
|
// with loading, using, modifying and/or developing or reproducing the
|
|
// software by the user in light of its specific status of free software,
|
|
// that may mean that it is complicated to manipulate, and that also
|
|
// therefore means that it is reserved for developers and experienced
|
|
// professionals having in-depth computer knowledge. Users are therefore
|
|
// encouraged to load and test the software's suitability as regards their
|
|
// requirements in conditions enabling the security of their systems and/or
|
|
// data to be ensured and, more generally, to use and operate it in the
|
|
// same conditions as regards security.
|
|
//
|
|
// The fact that you are presently reading this means that you have had
|
|
// knowledge of the CeCILL license and that you accept its terms.
|
|
|
|
#pragma once
|
|
|
|
#include "Cevo/Protocol.h"
|
|
|
|
namespace Cevo {
|
|
namespace CityProcessing {
|
|
|
|
// Equivalent of CityProcessing.pas (~1743 lines). FULLY PORTED. Its
|
|
// private implementation-section helpers (DetermineCityProdProcessing/
|
|
// DetermineCityTradeProcessing/BoostProd/SplitTrade/GetProjectCost/
|
|
// GetSmallCityReport/NextBest/NextWorst/NextPoll, plus the ProdProcessing/
|
|
// TradeProcessing/CityReportEx support structs) live in an anonymous
|
|
// namespace in CityProcessing.cpp, matching the original's own visibility
|
|
// (not part of its interface section either).
|
|
// CityTurn() needed a large prerequisite chain in Database.pas (Map
|
|
// Processing, most of Map Revealing, Tech Related Functions, a slice of
|
|
// Diplomacy, plus the SpecialModel[]/SpecialModelPreq[] tables) - see repo
|
|
// memory for the full list of what got ported to unblock it.
|
|
|
|
// Equivalent of CityProcessing.pas's GetCityAreaInfo().
|
|
void getCityAreaInfo(int p, int loc, TCityAreaInfo &cityAreaInfo);
|
|
|
|
// Equivalent of CityProcessing.pas's CanCityGrow().
|
|
bool canCityGrow(int p, int cix);
|
|
|
|
// Equivalent of CityProcessing.pas's GetCityReport()/GetCityReportNew().
|
|
int getCityReport(int p, int cix, TCityReport &cityReport);
|
|
int getCityReportNew(int p, int cix, TCityReportNew &cityReportNew);
|
|
|
|
// Equivalent of CityProcessing.pas's AddBestCityTile().
|
|
bool addBestCityTile(int p, int cix);
|
|
|
|
// Equivalent of CityProcessing.pas's CityGrowth()/CityShrink()/Pollute().
|
|
void cityGrowth(int p, int cix);
|
|
void cityShrink(int p, int cix);
|
|
void pollute(int p, int cix);
|
|
|
|
// Equivalent of CityProcessing.pas's PayCityMaintenance()/CollectCityResources().
|
|
void payCityMaintenance(int p, int cix);
|
|
void collectCityResources(int p, int cix);
|
|
|
|
// Equivalent of CityProcessing.pas's CityTurn(). Return value: whether the
|
|
// city keeps existing.
|
|
bool cityTurn(int p, int cix);
|
|
|
|
// Equivalent of CityProcessing.pas's SetCityTiles().
|
|
int setCityTiles(int p, int cix, int newTiles, bool testOnly = false);
|
|
|
|
// Equivalent of CityProcessing.pas's GetCityTileAdvice(): brute-force search
|
|
// over all "take N best tiles from each resource hierarchy" combinations to
|
|
// recommend the tile selection maximizing a weighted food/prod/tax/science
|
|
// value formula (weights packed into advice.ResourceWeights on input).
|
|
void getCityTileAdvice(int p, int cix, TCityTileAdviceData &advice);
|
|
|
|
// Equivalent of CityProcessing.pas's InitGame()/ReleaseGame().
|
|
void initGame();
|
|
void releaseGame();
|
|
|
|
} // namespace CityProcessing
|
|
} // namespace Cevo
|