From e848e6f1f7d0b59eae8677ca9784b00193cf069f Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 1 Oct 2024 13:35:15 +0100 Subject: [PATCH] feat: add PermissibleFactory --- .../endstone/detail/permissions/permissible.h | 46 +++++++++++++++++++ .../detail/permissions/permissible_base.h | 6 +-- include/endstone/permissions/permissible.h | 12 ----- src/endstone_core/actor/actor.cpp | 3 +- src/endstone_core/actor/mob.cpp | 3 +- src/endstone_core/command/command_adapter.cpp | 3 +- .../command/console_command_sender.cpp | 3 +- .../permissions/permissible_base.cpp | 6 ++- src/endstone_core/player.cpp | 3 +- 9 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 include/endstone/detail/permissions/permissible.h diff --git a/include/endstone/detail/permissions/permissible.h b/include/endstone/detail/permissions/permissible.h new file mode 100644 index 000000000..a4e6daa19 --- /dev/null +++ b/include/endstone/detail/permissions/permissible.h @@ -0,0 +1,46 @@ +// Copyright (c) 2024, The Endstone Project. (https://endstone.dev) All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace endstone::detail { + +class PermissibleFactory { +public: + enum class Option { + Normal, + Lazy + }; + + template