GithubHelp home page GithubHelp logo

似乎有个错误 about noahgameframe HOT 8 CLOSED

ketoo avatar ketoo commented on May 3, 2024
似乎有个错误

from noahgameframe.

Comments (8)

Johance2 avatar Johance2 commented on May 3, 2024

没错的, 原来就是你说的那样写的。 但是那是错误的,我要存的是。这个绑定的函数是属于哪个类的、
再移除的时候,先通过eventid找到 函数列表, 再通过函数指针找到是同一个类的,然后移除掉。

from noahgameframe.

cx421774557 avatar cx421774557 commented on May 3, 2024

喔,还没有细看,刚开始研究。但是这样写后无法编译通过,需要强制转换?

from noahgameframe.

Johance2 avatar Johance2 commented on May 3, 2024

我这边可以编译的。

from noahgameframe.

Johance2 avatar Johance2 commented on May 3, 2024

报错我看一下吧

from noahgameframe.

cx421774557 avatar cx421774557 commented on May 3, 2024

稍后,我为了编译过去,修改了一下那个map的模板参数,我先还原

from noahgameframe.

cx421774557 avatar cx421774557 commented on May 3, 2024

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C2440 “=”: 无法从“NFCGameScene *”转换为“std::function<int (int,const NFDataList &)> *” (编译源文件 ..\Classes\NF\Scene\NFCGameScene.cpp) NFDemo d:\tmp\github\noahgameframe\nfclient\cocos\classes\nf\logic\nfclogicbase.h 46

但是我将map模板参数改为std::map< MODULE_EVENT_FUNCTOR*, void*> mModuleEventPrtMap; 就没问题了,由于不知道具体架构,所以也不敢乱修改,才来求助的

from noahgameframe.

ketoo avatar ketoo commented on May 3, 2024

NoahGameFrame/NFClient/Cocos/Classes/NF/Logic/NFCLogicBase.h 第46行
应该是
mModuleEventPrtMap[pBase] = functorPtr.get();

直接存functorPtr对象不是更好吗。。。。

from noahgameframe.

Johance2 avatar Johance2 commented on May 3, 2024

我这边功能是 需要 移除掉,指定的类的绑定函数,但是 std::fun不知道如何获取那个值。所以多做了一层 fun对应的 classs ptr
之前我弄错目录了。==、 没提交上去。
std::map<void*, void*> mModuleEventPrtMap; 都改成void*了

from noahgameframe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.