mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Rename radious -> radius
There is no such English word, "radious" Some files get new lines in the end - BSD sed bug + best practices
This commit is contained in:
parent
4352f49a1d
commit
3926920103
@ -1,2 +1,2 @@
|
||||
// Creates the precompiled header
|
||||
#include "StdInc.h"
|
||||
#include "StdInc.h"
|
||||
|
@ -1,2 +1,2 @@
|
||||
// Creates the precompiled header
|
||||
#include "StdInc.h"
|
||||
#include "StdInc.h"
|
||||
|
@ -16,4 +16,4 @@ extern "C" DLL_EXPORT void GetAiName(char* name)
|
||||
extern "C" DLL_EXPORT void GetNewAI(std::shared_ptr<CGlobalAI> &out)
|
||||
{
|
||||
out = std::make_shared<CEmptyAI>();
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
// Creates the precompiled header
|
||||
#include "StdInc.h"
|
||||
#include "StdInc.h"
|
||||
|
@ -360,7 +360,7 @@ bool canBeEmbarkmentPoint(const TerrainTile *t, bool fromWater)
|
||||
int3 whereToExplore(HeroPtr h)
|
||||
{
|
||||
TimeCheck tc ("where to explore");
|
||||
int radius = h->getSightRadious();
|
||||
int radius = h->getSightRadius();
|
||||
int3 hpos = h->visitablePos();
|
||||
|
||||
auto sm = ai->getCachedSectorMap(h);
|
||||
|
@ -2554,7 +2554,7 @@ int3 VCAI::explorationBestNeighbour(int3 hpos, int radius, HeroPtr h)
|
||||
|
||||
int3 VCAI::explorationNewPoint(HeroPtr h)
|
||||
{
|
||||
int radius = h->getSightRadious();
|
||||
int radius = h->getSightRadius();
|
||||
CCallback * cbp = cb.get();
|
||||
const CGHeroInstance * hero = h.get();
|
||||
|
||||
@ -2603,7 +2603,7 @@ int3 VCAI::explorationNewPoint(HeroPtr h)
|
||||
int3 VCAI::explorationDesperate(HeroPtr h)
|
||||
{
|
||||
auto sm = getCachedSectorMap(h);
|
||||
int radius = h->getSightRadious();
|
||||
int radius = h->getSightRadius();
|
||||
|
||||
std::vector<std::vector<int3> > tiles; //tiles[distance_to_fow]
|
||||
tiles.resize(radius);
|
||||
|
@ -988,10 +988,10 @@ void CGameState::initGrailPosition()
|
||||
{
|
||||
logGlobal->debugStream() << "\tPicking grail position";
|
||||
//pick grail location
|
||||
if(map->grailPos.x < 0 || map->grailRadious) //grail not set or set within a radius around some place
|
||||
if(map->grailPos.x < 0 || map->grailRadius) //grail not set or set within a radius around some place
|
||||
{
|
||||
if(!map->grailRadious) //radius not given -> anywhere on map
|
||||
map->grailRadious = map->width * 2;
|
||||
if(!map->grailRadius) //radius not given -> anywhere on map
|
||||
map->grailRadius = map->width * 2;
|
||||
|
||||
std::vector<int3> allowedPos;
|
||||
static const int BORDER_WIDTH = 9; // grail must be at least 9 tiles away from border
|
||||
@ -1008,7 +1008,7 @@ void CGameState::initGrailPosition()
|
||||
&& !t.visitable
|
||||
&& t.terType != ETerrainType::WATER
|
||||
&& t.terType != ETerrainType::ROCK
|
||||
&& map->grailPos.dist2dSQ(int3(i, j, k)) <= (map->grailRadious * map->grailRadious))
|
||||
&& map->grailPos.dist2dSQ(int3(i, j, k)) <= (map->grailRadius * map->grailRadius))
|
||||
allowedPos.push_back(int3(i,j,k));
|
||||
}
|
||||
}
|
||||
@ -1638,7 +1638,7 @@ void CGameState::initFogOfWar()
|
||||
if(!obj || !vstd::contains(elem.second.players, obj->tempOwner)) continue; //not a flagged object
|
||||
|
||||
std::unordered_set<int3, ShashInt3> tiles;
|
||||
getTilesInRange(tiles, obj->getSightCenter(), obj->getSightRadious(), obj->tempOwner, 1);
|
||||
getTilesInRange(tiles, obj->getSightCenter(), obj->getSightRadius(), obj->tempOwner, 1);
|
||||
for(int3 tile : tiles)
|
||||
{
|
||||
elem.second.fogOfWarMap[tile.x][tile.y][tile.z] = 1;
|
||||
|
@ -646,10 +646,10 @@ void CPathfinder::initializePatrol()
|
||||
auto state = PATROL_NONE;
|
||||
if(hero->patrol.patrolling && !getPlayer(hero->tempOwner)->human)
|
||||
{
|
||||
if(hero->patrol.patrolRadious)
|
||||
if(hero->patrol.patrolRadius)
|
||||
{
|
||||
state = PATROL_RADIUS;
|
||||
gs->getTilesInRange(patrolTiles, hero->patrol.initialPos, hero->patrol.patrolRadious, boost::optional<PlayerColor>(), 0, true);
|
||||
gs->getTilesInRange(patrolTiles, hero->patrol.initialPos, hero->patrol.patrolRadius, boost::optional<PlayerColor>(), 0, true);
|
||||
}
|
||||
else
|
||||
state = PATROL_LOCKED;
|
||||
|
@ -33,7 +33,7 @@ class CSelector : std::function<bool(const Bonus*)>
|
||||
public:
|
||||
CSelector() {}
|
||||
template<typename T>
|
||||
CSelector(const T &t, //SFINAE trick -> include this c-tor in overload resolution only if parameter is class
|
||||
CSelector(const T &t, //SFINAE trick -> include this c-tor in overload resolution only if parameter is class
|
||||
//(includes functors, lambdas) or function. Without that VC is going mad about ambiguities.
|
||||
typename std::enable_if < boost::mpl::or_ < std::is_class<T>, std::is_function<T >> ::value>::type *dummy = nullptr)
|
||||
: TBase(t)
|
||||
@ -79,7 +79,7 @@ public:
|
||||
BONUS_NAME(MORALE) \
|
||||
BONUS_NAME(LUCK) \
|
||||
BONUS_NAME(PRIMARY_SKILL) /*uses subtype to pick skill; additional info if set: 1 - only melee, 2 - only distance*/ \
|
||||
BONUS_NAME(SIGHT_RADIOUS) \
|
||||
BONUS_NAME(SIGHT_RADIOUS) /*the correct word is RADIUS, but this one's already used in mods */\
|
||||
BONUS_NAME(MANA_REGENERATION) /*points per turn apart from normal (1 + mysticism)*/ \
|
||||
BONUS_NAME(FULL_MANA_REGENERATION) /*all mana points are replenished every day*/ \
|
||||
BONUS_NAME(NONEVIL_ALIGNMENT_MIX) /*good and neutral creatures can be mixed without morale penalty*/ \
|
||||
@ -219,7 +219,7 @@ public:
|
||||
BONUS_NAME(VISIONS) /* subtype - spell level */\
|
||||
BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\
|
||||
/* end of list */
|
||||
|
||||
|
||||
|
||||
#define BONUS_SOURCE_LIST \
|
||||
BONUS_SOURCE(ARTIFACT)\
|
||||
@ -345,7 +345,7 @@ struct DLL_LINKAGE Bonus
|
||||
static bool NTurns(const Bonus *hb)
|
||||
{
|
||||
return hb->duration & Bonus::N_TURNS;
|
||||
}
|
||||
}
|
||||
static bool OneDay(const Bonus *hb)
|
||||
{
|
||||
return hb->duration & Bonus::ONE_DAY;
|
||||
@ -754,7 +754,7 @@ public:
|
||||
: ptr(Ptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CSelector operator()(const T &valueToCompareAgainst) const
|
||||
{
|
||||
auto ptr2 = ptr; //We need a COPY because we don't want to reference this (might be outlived by lambda)
|
||||
|
@ -55,4 +55,4 @@ struct SharedMem
|
||||
delete mr;
|
||||
boost::interprocess::shared_memory_object::remove("vcmi_memory");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -223,7 +223,7 @@ DLL_LINKAGE void FoWChange::applyGs( CGameState *gs )
|
||||
case Obj::TOWN:
|
||||
case Obj::ABANDONED_MINE:
|
||||
if(vstd::contains(team->players, o->tempOwner)) //check owned observators
|
||||
gs->getTilesInRange(tilesRevealed, o->getSightCenter(), o->getSightRadious(), o->tempOwner, 1);
|
||||
gs->getTilesInRange(tilesRevealed, o->getSightCenter(), o->getSightRadius(), o->tempOwner, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -113,4 +113,4 @@ Res::ResourceSet::nziterator::nziterator(const ResourceSet &RS)
|
||||
|
||||
if(!valid())
|
||||
advance();
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
// Creates the precompiled header
|
||||
#include "StdInc.h"
|
||||
#include "StdInc.h"
|
||||
|
@ -4,4 +4,4 @@
|
||||
|
||||
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
|
||||
|
||||
// Here you can add specific libraries and macros which are specific to this project.
|
||||
// Here you can add specific libraries and macros which are specific to this project.
|
||||
|
@ -55,4 +55,4 @@ class DLL_LINKAGE IVCMIDirs
|
||||
namespace VCMIDirs
|
||||
{
|
||||
extern DLL_LINKAGE const IVCMIDirs& get();
|
||||
}
|
||||
}
|
||||
|
@ -1067,7 +1067,7 @@ int3 CGHeroInstance::getSightCenter() const
|
||||
return getPosition(false);
|
||||
}*/
|
||||
|
||||
int CGHeroInstance::getSightRadious() const
|
||||
int CGHeroInstance::getSightRadius() const
|
||||
{
|
||||
return 5 + getSecSkillLevel(SecondarySkill::SCOUTING) + valOfBonuses(Bonus::SIGHT_RADIOUS); //default + scouting
|
||||
}
|
||||
|
@ -76,10 +76,10 @@ public:
|
||||
|
||||
struct DLL_LINKAGE Patrol
|
||||
{
|
||||
Patrol(){patrolling=false;initialPos=int3();patrolRadious=-1;};
|
||||
Patrol(){patrolling=false;initialPos=int3();patrolRadius=-1;};
|
||||
bool patrolling;
|
||||
int3 initialPos;
|
||||
ui32 patrolRadious;
|
||||
ui32 patrolRadius;
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & patrolling;
|
||||
@ -92,7 +92,7 @@ public:
|
||||
patrolling = false;
|
||||
initialPos = int3();
|
||||
}
|
||||
h & patrolRadious;
|
||||
h & patrolRadius;
|
||||
}
|
||||
} patrol;
|
||||
|
||||
@ -134,7 +134,7 @@ public:
|
||||
}
|
||||
|
||||
//int3 getSightCenter() const; //"center" tile from which the sight distance is calculated
|
||||
int getSightRadious() const override; //sight distance (should be used if player-owned structure)
|
||||
int getSightRadius() const override; //sight distance (should be used if player-owned structure)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
|
||||
|
@ -313,7 +313,7 @@ void CGDwelling::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer)
|
||||
}
|
||||
}
|
||||
|
||||
int CGTownInstance::getSightRadious() const //returns sight distance
|
||||
int CGTownInstance::getSightRadius() const //returns sight distance
|
||||
{
|
||||
if (subID == ETownType::TOWER)
|
||||
{
|
||||
@ -1109,7 +1109,7 @@ void CGTownInstance::battleFinished(const CGHeroInstance *hero, const BattleResu
|
||||
FoWChange fw;
|
||||
fw.player = hero->tempOwner;
|
||||
fw.mode = 1;
|
||||
cb->getTilesInRange(fw.tiles, getSightCenter(), getSightRadious(), tempOwner, 1);
|
||||
cb->getTilesInRange(fw.tiles, getSightCenter(), getSightRadius(), tempOwner, 1);
|
||||
cb->sendAndApply (&fw);
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public:
|
||||
|
||||
bool passableFor(PlayerColor color) const override;
|
||||
//int3 getSightCenter() const override; //"center" tile from which the sight distance is calculated
|
||||
int getSightRadious() const override; //returns sight distance
|
||||
int getSightRadius() const override; //returns sight distance
|
||||
int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
|
||||
void getOutOffsets(std::vector<int3> &offsets) const override; //offsets to obj pos when we boat can be placed. Parameter will be cleared
|
||||
int getMarketEfficiency() const override; //=market count
|
||||
|
@ -243,7 +243,7 @@ int3 CGObjectInstance::getSightCenter() const
|
||||
return visitablePos();
|
||||
}
|
||||
|
||||
int CGObjectInstance::getSightRadious() const
|
||||
int CGObjectInstance::getSightRadius() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
/// Returns true if player can pass through visitable tiles of this object
|
||||
virtual bool passableFor(PlayerColor color) const;
|
||||
/// Range of revealed map around this object, counting from getSightCenter()
|
||||
virtual int getSightRadious() const;
|
||||
virtual int getSightRadius() const;
|
||||
/// returns (x,y,0) offset to a visitable tile of object
|
||||
virtual int3 getVisitableOffset() const;
|
||||
/// Called mostly during map randomization to turn random object into a regular one (e.g. "Random Monster" into "Pikeman")
|
||||
|
@ -220,7 +220,7 @@ CMapHeader::~CMapHeader()
|
||||
|
||||
}
|
||||
|
||||
CMap::CMap() : checksum(0), grailPos(-1, -1, -1), grailRadious(0), terrain(nullptr)
|
||||
CMap::CMap() : checksum(0), grailPos(-1, -1, -1), grailRadius(0), terrain(nullptr)
|
||||
{
|
||||
allHeroes.resize(allowedHeroes.size());
|
||||
allowedAbilities = VLC->heroh->getDefaultAllowedAbilities();
|
||||
|
@ -306,7 +306,7 @@ public:
|
||||
std::vector<bool> allowedAbilities;
|
||||
std::list<CMapEvent> events;
|
||||
int3 grailPos;
|
||||
int grailRadious;
|
||||
int grailRadius;
|
||||
|
||||
//Central lists of items in game. Position of item in the vectors below is their (instance) id.
|
||||
std::vector< ConstTransitivePtr<CGObjectInstance> > objects;
|
||||
|
@ -1350,7 +1350,7 @@ void CMapLoaderH3M::readObjects()
|
||||
case Obj::GRAIL:
|
||||
{
|
||||
map->grailPos = objPos;
|
||||
map->grailRadious = reader.readUInt32();
|
||||
map->grailRadius = reader.readUInt32();
|
||||
continue;
|
||||
}
|
||||
case Obj::RANDOM_DWELLING: //same as castle + level range
|
||||
@ -1650,8 +1650,8 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven, const i
|
||||
|
||||
nhi->formation = reader.readUInt8();
|
||||
loadArtifactsOfHero(nhi);
|
||||
nhi->patrol.patrolRadious = reader.readUInt8();
|
||||
if(nhi->patrol.patrolRadious == 0xff)
|
||||
nhi->patrol.patrolRadius = reader.readUInt8();
|
||||
if(nhi->patrol.patrolRadius == 0xff)
|
||||
{
|
||||
nhi->patrol.patrolling = false;
|
||||
}
|
||||
|
@ -16,4 +16,4 @@
|
||||
#include "CDefaultSpellMechanics.h"
|
||||
#include "AdventureSpellMechanics.h"
|
||||
#include "BattleSpellMechanics.h"
|
||||
#include "CreatureSpellMechanics.h"
|
||||
#include "CreatureSpellMechanics.h"
|
||||
|
@ -1869,7 +1869,7 @@ bool CGameHandler::moveHero( ObjectInstanceID hid, int3 dst, ui8 teleporting, bo
|
||||
{
|
||||
obj->onHeroLeave(h);
|
||||
}
|
||||
this->getTilesInRange(tmh.fowRevealed, h->getSightCenter()+(tmh.end-tmh.start), h->getSightRadious(), h->tempOwner, 1);
|
||||
this->getTilesInRange(tmh.fowRevealed, h->getSightCenter()+(tmh.end-tmh.start), h->getSightRadius(), h->tempOwner, 1);
|
||||
};
|
||||
|
||||
auto doMove = [&](TryMoveHero::EResult result, EGuardLook lookForGuards,
|
||||
@ -2736,7 +2736,7 @@ bool CGameHandler::buildStructure( ObjectInstanceID tid, BuildingID requestedID,
|
||||
FoWChange fw;
|
||||
fw.player = t->tempOwner;
|
||||
fw.mode = 1;
|
||||
getTilesInRange(fw.tiles, t->getSightCenter(), t->getSightRadious(), t->tempOwner, 1);
|
||||
getTilesInRange(fw.tiles, t->getSightCenter(), t->getSightRadius(), t->tempOwner, 1);
|
||||
sendAndApply(&fw);
|
||||
|
||||
if(t->visitingHero)
|
||||
@ -5822,11 +5822,11 @@ void CGameHandler::changeFogOfWar(int3 center, ui32 radius, PlayerColor player,
|
||||
auto p = gs->getPlayer(player);
|
||||
for (auto h : p->heroes)
|
||||
{
|
||||
getTilesInRange(observedTiles, h->getSightCenter(), h->getSightRadious(), h->tempOwner, -1);
|
||||
getTilesInRange(observedTiles, h->getSightCenter(), h->getSightRadius(), h->tempOwner, -1);
|
||||
}
|
||||
for (auto t : p->towns)
|
||||
{
|
||||
getTilesInRange(observedTiles, t->getSightCenter(), t->getSightRadious(), t->tempOwner, -1);
|
||||
getTilesInRange(observedTiles, t->getSightCenter(), t->getSightRadius(), t->tempOwner, -1);
|
||||
}
|
||||
for (auto tile : observedTiles)
|
||||
vstd::erase_if_present (tiles, tile);
|
||||
|
@ -97,4 +97,4 @@ public:
|
||||
void startListeningThread(CConnection * pc);
|
||||
};
|
||||
|
||||
extern boost::program_options::variables_map cmdLineOptions;
|
||||
extern boost::program_options::variables_map cmdLineOptions;
|
||||
|
@ -1,2 +1,2 @@
|
||||
// Creates the precompiled header
|
||||
#include "StdInc.h"
|
||||
#include "StdInc.h"
|
||||
|
Loading…
Reference in New Issue
Block a user