Browse Source

fix(CAPI): 🐛 fix "const auto&", and some format fix

tags/0.1.0
DragonAura 2 years ago
parent
commit
403798ecfa
9 changed files with 13 additions and 13 deletions
  1. +1
    -1
      CAPI/API/include/AI.h
  2. +1
    -1
      CAPI/API/include/API.h
  3. +1
    -1
      CAPI/API/include/constants.h
  4. +1
    -1
      CAPI/API/include/logic.h
  5. +1
    -1
      CAPI/API/include/state.h
  6. +1
    -1
      CAPI/API/include/utils.hpp
  7. +1
    -1
      CAPI/API/src/DebugAPI.cpp
  8. +5
    -5
      CAPI/API/src/logic.cpp
  9. +1
    -1
      CAPI/API/src/main.cpp

+ 1
- 1
CAPI/API/include/AI.h View File

@@ -28,4 +28,4 @@ public:
void play(IButcherAPI& api) override;
};

#endif
#endif

+ 1
- 1
CAPI/API/include/API.h View File

@@ -367,4 +367,4 @@ private:
ILogic& logic;
};

#endif
#endif

+ 1
- 1
CAPI/API/include/constants.h View File

@@ -5,4 +5,4 @@
namespace Constants
{
}
#endif
#endif

+ 1
- 1
CAPI/API/include/logic.h View File

@@ -151,4 +151,4 @@ public:
void Main(CreateAIFunc createAI, std::string IP, std::string port, bool level, std::string filename);
};

#endif
#endif

+ 1
- 1
CAPI/API/include/state.h View File

@@ -25,4 +25,4 @@ struct State
std::vector<int64_t> guids;
};

#endif
#endif

+ 1
- 1
CAPI/API/include/utils.hpp View File

@@ -297,4 +297,4 @@ namespace THUAI62Proto
}
} // namespace THUAI62Proto

#endif
#endif

+ 1
- 1
CAPI/API/src/DebugAPI.cpp View File

@@ -308,4 +308,4 @@ void HumanDebugAPI::Play(IAI& ai)
void ButcherDebugAPI::Play(IAI& ai)
{
ai.play(*this);
}
}

+ 5
- 5
CAPI/API/src/logic.cpp View File

@@ -233,7 +233,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message)
bufferState->gamemap = Proto2THUAI6::Protobuf2THUAI6Map(message.map_message());
if (playerType == THUAI6::PlayerType::HumanPlayer)
{
for (auto item : message.human_message())
for (const auto& item : message.human_message())
{
if (item.player_id() == playerID)
{
@@ -241,7 +241,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message)
}
bufferState->humans.push_back(Proto2THUAI6::Protobuf2THUAI6Human(item));
}
for (auto item : message.butcher_message())
for (const auto& item : message.butcher_message())
{
int vr = this->bufferState->humanSelf->viewRange;
int deltaX = item.x() - this->bufferState->humanSelf->x;
@@ -277,7 +277,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message)
}
else
{
for (auto item : message.butcher_message())
for (const auto& item : message.butcher_message())
{
if (item.player_id() == playerID)
{
@@ -285,7 +285,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message)
}
bufferState->butchers.push_back(Proto2THUAI6::Protobuf2THUAI6Butcher(item));
}
for (auto item : message.human_message())
for (const auto& item : message.human_message())
{
int vr = this->bufferState->butcherSelf->viewRange;
int deltaX = item.x() - this->bufferState->butcherSelf->x;
@@ -319,7 +319,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message)
}
}
}
for (auto item : message.prop_message())
for (const auto& item : message.prop_message())
bufferState->props.push_back(Proto2THUAI6::Protobuf2THUAI6Prop(item));
if (asynchronous)
{


+ 1
- 1
CAPI/API/src/main.cpp View File

@@ -83,4 +83,4 @@ std::unique_ptr<IAI> CreateAI()
int main(int argc, char* argv[])
{
return THUAI6Main(argc, argv, CreateAI);
}
}

Loading…
Cancel
Save