From f86a78f9942bd6454aac9719efc7a45f7582e1f8 Mon Sep 17 00:00:00 2001 From: Antoine Albertelli Date: Mon, 21 Aug 2023 11:35:48 +0200 Subject: [PATCH] Use GOAP's distance API in example --- lib/goap/example.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/goap/example.cpp b/lib/goap/example.cpp index 87e3bb6c..aa76238c 100644 --- a/lib/goap/example.cpp +++ b/lib/goap/example.cpp @@ -15,10 +15,7 @@ bool operator==(const LumberjackState& b, const LumberjackState& a) struct ForestryGoal : goap::Goal { int distance_to(const LumberjackState& state) const override { - if (state.has_wood) { - return 0; - } - return 1; + return goap::Distance().shouldBeTrue(state.has_wood); } };