Add nullability to large parts of the codebase
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user