Skip to content

Commit

Permalink
fix: compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Feb 28, 2024
1 parent 65d0671 commit 99bf036
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
5 changes: 0 additions & 5 deletions include/endstone/command/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ namespace endstone {
*/
class Command {
public:
explicit Command(CommandMap &command_map) : command_map_(command_map) {}
virtual ~Command() = default;

public:
/**
* Executes the command, returning its success
*
Expand Down Expand Up @@ -67,8 +65,5 @@ class Command {
{
return {};
}

private:
CommandMap &command_map_;
};
} // namespace endstone
19 changes: 19 additions & 0 deletions include/endstone/command/command_usage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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

class CommandUsage {

};
3 changes: 2 additions & 1 deletion include/endstone/command/plugin_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace endstone {
class PluginCommand : public Command {
public:
PluginCommand(CommandMap &command_map, Plugin &owner) : Command(command_map), owner_(owner) {}
PluginCommand(CommandMap &command_map, Plugin &owner) : command_map_(command_map), owner_(owner) {}

bool execute(CommandSender &sender, const std::map<std::string, std::string> &args) const override
{
Expand Down Expand Up @@ -82,5 +82,6 @@ class PluginCommand : public Command {
private:
Plugin &owner_;
std::shared_ptr<CommandExecutor> executor_;
CommandMap &command_map_;
};
} // namespace endstone
2 changes: 1 addition & 1 deletion src/endstone_runtime/linux/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const std::error_category &hook_error_category()
{
static const class HookErrorCategory : public std::error_category {
public:
[[nodiscard]] const char *name() const override
[[nodiscard]] const char *name() const noexcept override
{
return "HookError";
}
Expand Down
2 changes: 1 addition & 1 deletion src/endstone_runtime/windows/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const std::error_category &hook_error_category()
{
static const class HookErrorCategory : public std::error_category {
public:
[[nodiscard]] const char *name() const override
[[nodiscard]] const char *name() const noexcept override
{
return "HookError";
}
Expand Down

0 comments on commit 99bf036

Please sign in to comment.