在我们的许多项目中,我们在 build.gradle 和 settings.gradle 中定义了存储库块,它们看起来像这样:
构建.gradle
repositories {
    maven {
        url { custom_nexus_repository }
    }
    maven {
        url { custom_repository }
    }
}
设置.gradle
pluginManagement {
    repositories {
        maven {
            url "${custom_repository}"
            allowInsecureProtocol = true
        }
        maven {
            url "${custom_nexus_repository}"
            allowInsecureProtocol = true
        }
    }
}
settings.gradle在AND中定义它的目的是什么build.gradle?两者之一还不够吗?
如果我需要阅读很多代码,我很抱歉,如果我可以简化解释请告诉我,如果你想评论我的设计/实践是免费的.
所以我的播放器被删除了两次,我不知道为什么.如果查看调用堆栈,您会看到GameEventManager实际上是在GameState析构函数之前调用Player析构函数,即使GameState是指向Player的指针.我想也许这是因为它还会先破坏矢量,所以它会在矢量中找到Player并试图摧毁它.我不知道为什么它会试图摧毁播放器,因为仍然存在GameState对象所知道的Player的引用.共享指针功能应该阻止播放器被破坏.
也许我会以错误的方式解决这个问题,如果是这样,有人会指出我在这里的最佳做法的正确方向?谢谢
调用堆栈:
 
 
 GameState.h
GameState.h
#ifndef _level
#define _level
#include <vector>
#include "Player.h"
#include <memory>
using namespace std;
class GameState // A representation of the Level/Game/Scene
{
public:
    GameState();
    virtual ~GameState() {}
    //Keep track of the game's state
    //Maybe get rid of the Level class, and make this a class, and move the Level functionality here?
    static void EndGame(const bool & b) { mbEndGame = b; }
    static const bool & EndGame() { return mbEndGame; }
private:
    void SetPlayer(shared_ptr<Player> sptrPlayer) …