Add nullability to large parts of the codebase
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-03-23 18:30:35 +01:00
parent beb2e44a0b
commit eccf2c9121
53 changed files with 240 additions and 206 deletions

View File

@@ -19,7 +19,7 @@ namespace CreatureLib::Battling {
}
ArbUt::OptionalBorrowedPtr<const HistoryElement>
HistoryHolder::GetLastUsedAttackOnTarget(Creature* target, u32 maxDepth) const noexcept {
HistoryHolder::GetLastUsedAttackOnTarget(Creature* non_null target, u32 maxDepth) const noexcept {
ArbUt::OptionalBorrowedPtr<const HistoryElement> c = _top;
auto turn = _getTurnNumber();
while (c.HasValue()) {

View File

@@ -11,7 +11,7 @@ concept HistoryElementType = std::is_base_of<CreatureLib::Battling::HistoryEleme
namespace CreatureLib::Battling {
class HistoryHolder {
HistoryElement* _top = nullptr;
HistoryElement* nullable _top = nullptr;
std::function<u32()> _getTurnNumber;
public:
@@ -33,7 +33,7 @@ namespace CreatureLib::Battling {
GetLastUsedAttack(u32 maxDepth = 0) const noexcept;
[[nodiscard]] ArbUt::OptionalBorrowedPtr<const HistoryElement>
GetLastUsedAttackOnTarget(Creature* target, u32 maxDepth = 0) const noexcept;
GetLastUsedAttackOnTarget(Creature* non_null target, u32 maxDepth = 0) const noexcept;
[[nodiscard]] ArbUt::OptionalBorrowedPtr<const HistoryElement>
GetLastDamageOnTarget(const ArbUt::BorrowedPtr<const Creature>& creature, u32 maxDepth = 0) const noexcept;