/* * 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_EBT_HPP #define ANTKEEPER_EBT_HPP #include "game/behavior/behavior-tree.hpp" #include /// Entity Behavior Tree /** * The `ebt` namespace defines Entity Behavior Tree (EBT) nodes and an EBT context, on which EBT nodes operate. */ namespace ebt { /** * EBT context which references an entity and its registry. */ struct context { entt::registry* registry; entt::entity entity; }; typedef behavior_tree::status status; typedef behavior_tree::node node; typedef behavior_tree::leaf_node leaf_node; typedef behavior_tree::decorator_node decorator_node; typedef behavior_tree::composite_node composite_node; typedef behavior_tree::action action; typedef behavior_tree::condition condition; typedef behavior_tree::inverter inverter; typedef behavior_tree::repeater repeater; typedef behavior_tree::succeeder succeeder; typedef behavior_tree::sequence sequence; typedef behavior_tree::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 #endif // ANTKEEPER_EBT_HPP