/* * Copyright (C) 2021 Christopher J. Howard * * This file is part of Antkeeper source code. * * Antkeeper source code is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Antkeeper source code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Antkeeper source code. If not, see . */ #ifndef ANTKEEPER_ENTITY_EBT_HPP #define ANTKEEPER_ENTITY_EBT_HPP #include "ai/behavior-tree.hpp" #include "entity/id.hpp" #include "entity/registry.hpp" namespace entity { /// Entity behavior tree (EBT) nodes and context. namespace ebt { /** * EBT context which references an entity and its registry. */ struct context { entity::registry* registry; entity::id entity_id; }; typedef ai::bt::status status; typedef ai::bt::node node; typedef ai::bt::leaf_node leaf_node; typedef ai::bt::decorator_node decorator_node; typedef ai::bt::composite_node composite_node; typedef ai::bt::action action; typedef ai::bt::condition condition; typedef ai::bt::inverter inverter; typedef ai::bt::repeater repeater; typedef ai::bt::succeeder succeeder; typedef ai::bt::sequence sequence; typedef ai::bt::selector selector; // Actions status print(context& context, const std::string& text); status print_eid(context& context); status warp_to(context& context, float x, float y, float z); // Conditions bool is_carrying_food(const context& context); } // namespace ebt } // namespace entity #endif // ANTKEEPER_ENTITY_EBT_HPP