1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-04 00:15:53 +02:00
vcmi/lib/battle
Ivan Savenko 81e6207df0 Add helper functions for integer division rounding
Added set of functions that perform integer division with different
rounding modes:
- divideAndCeil - rounds up to next integer
- divideAndRound - rounds to nearest integer
- divideAndFloor - rounds to previous integer (equivalent to default
division)

Intended for use in library, where usage of floating point might lead to
desync in multiplayer games.

Replaced some cases that I knew of, including recent handicap PR
2024-08-03 13:52:14 +00:00
..
AccessibilityInfo.cpp
AccessibilityInfo.h
AutocombatPreferences.h
BattleAction.cpp
BattleAction.h Refactoring of serialization versioning handling 2024-01-20 20:34:51 +02:00
BattleAttackInfo.cpp
BattleAttackInfo.h
BattleHex.cpp
BattleHex.h Refactoring of serialization versioning handling 2024-01-20 20:34:51 +02:00
BattleInfo.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
BattleInfo.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
BattleProxy.cpp
BattleProxy.h
BattleStateInfoForRetreat.cpp
BattleStateInfoForRetreat.h
CBattleInfoCallback.cpp Merge pull request #4330 from Laserlicht/spellbook 2024-07-27 19:34:50 +03:00
CBattleInfoCallback.h Implemented simple target selection logic for arrow towers 2024-07-21 13:16:33 +00:00
CBattleInfoEssentials.cpp Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00
CBattleInfoEssentials.h Fix BattleEvaluator.cpp:286:32: error: function 'battleGetAllObstacles' with deduced return type cannot be used before it is defined 2024-01-17 14:41:47 +00:00
CObstacleInstance.cpp Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
CObstacleInstance.h Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
CPlayerBattleCallback.cpp Add missing semicolon after macro usage 2024-01-16 20:18:18 +00:00
CPlayerBattleCallback.h
CUnitState.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
CUnitState.h proper logging of drained life and resurrected count 2024-06-09 23:54:20 +02:00
DamageCalculator.cpp Add helper functions for integer division rounding 2024-08-03 13:52:14 +00:00
DamageCalculator.h
Destination.cpp
Destination.h
IBattleInfoCallback.h Remove trailing semicolons from more macros 2024-01-16 19:46:21 +00:00
IBattleState.cpp
IBattleState.h
IUnitInfo.h
PossiblePlayerBattleAction.h Fix alternative actions to support more than 2 actions + simplify logic 2024-07-15 00:41:05 +02:00
ReachabilityInfo.cpp BattleAI: fix moving to unreachable in case of back-to-back 2-hex 2024-07-14 11:46:45 +03:00
ReachabilityInfo.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
SideInBattle.cpp
SideInBattle.h Refactoring of serialization versioning handling 2024-01-20 20:34:51 +02:00
SiegeInfo.cpp
SiegeInfo.h Refactoring of serialization versioning handling 2024-01-20 20:34:51 +02:00
Unit.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
Unit.h Fixed issues from review 2024-06-11 16:47:23 +02:00