MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / TileDistanceProcess

Class TileDistanceProcess

source/gamemap/TileContainer.cpp:265–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263};
264
265class TileDistanceProcess
266{
267public:
268 TileDistanceProcess(const TileDistance& tileDistance, Tile* tile):
269 mTileDistance(tileDistance),
270 mTile(tile),
271 mHiddenValueNorth(0.0),
272 mHiddenValueSouth(0.0)
273 {
274 }
275
276 inline const TileDistance& getTileDistance() const
277 {
278 return mTileDistance;
279 }
280
281 void addHiddenValueNorth(double val)
282 {
283 // We only add the highest value
284 if(val <= mHiddenValueNorth)
285 return;
286
287 mHiddenValueNorth = val;
288 }
289
290 void addHiddenValueSouth(double val)
291 {
292 // We only add the highest value
293 if(val <= mHiddenValueSouth)
294 return;
295
296 mHiddenValueSouth = val;
297 }
298
299 inline bool isTileVisible() const
300 {
301 return (mHiddenValueNorth + mHiddenValueSouth) <= 0.5;
302 }
303
304 inline double getHiddenValueNorth() const
305 {
306 return mHiddenValueNorth;
307 }
308
309 inline double getHiddenValueSouth() const
310 {
311 return mHiddenValueSouth;
312 }
313
314 inline Tile* getTile() const
315 {
316 return mTile;
317 }
318
319private:
320 const TileDistance& mTileDistance;
321 Tile* mTile;
322 double mHiddenValueNorth;

Callers 1

visibleTilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected