mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Completely remove IGameCallback class
- CClient now inherits directly from CPrivilegedInfoCallback, like IGameCallback did before. However CClient no longer needs dummy implementation of IGameEventCallback - CGObjectInstance hierarchy now uses CPrivilegedInfoCallback for callback. Actual events can only be emitted in calls that receive IGameEventCallback pointer, e.g. heroVisit - CGameHandler now inherits directly from both CPrivilegedInfoCallback and IGameEventCallback as it did before via IGameCallback
This commit is contained in:
@@ -230,7 +230,7 @@ bool ObstacleProxy::isProhibited(const rmg::Area& objArea) const
|
||||
return false;
|
||||
};
|
||||
|
||||
int ObstacleProxy::getWeightedObjects(const int3 & tile, vstd::RNG & rand, IGameCallback * cb, std::list<rmg::Object> & allObjects, std::vector<std::pair<rmg::Object*, int3>> & weightedObjects)
|
||||
int ObstacleProxy::getWeightedObjects(const int3 & tile, vstd::RNG & rand, CPrivilegedInfoCallback * cb, std::list<rmg::Object> & allObjects, std::vector<std::pair<rmg::Object*, int3>> & weightedObjects)
|
||||
{
|
||||
int maxWeight = std::numeric_limits<int>::min();
|
||||
for(auto & possibleObstacle : possibleObstacles)
|
||||
@@ -311,7 +311,7 @@ int ObstacleProxy::getWeightedObjects(const int3 & tile, vstd::RNG & rand, IGame
|
||||
return maxWeight;
|
||||
}
|
||||
|
||||
std::set<std::shared_ptr<CGObjectInstance>> ObstacleProxy::createObstacles(vstd::RNG & rand, IGameCallback * cb)
|
||||
std::set<std::shared_ptr<CGObjectInstance>> ObstacleProxy::createObstacles(vstd::RNG & rand, CPrivilegedInfoCallback * cb)
|
||||
{
|
||||
//reverse order, since obstacles begin in bottom-right corner, while the map coordinates begin in top-left
|
||||
auto blockedTiles = blockedArea.getTilesVector();
|
||||
|
||||
Reference in New Issue
Block a user