Neko Hz

Results 139 comments of Neko Hz

I think using global object as namespace is a better idea(

TIP3: Namespace cannot be extended in future, you can only define the entries at once

```c++ struct Events { }; Events e; chai.add(user_type(), "Events"); chai.add_global(var(e), "events"); chai.add(fun([](Events e, function actor) { ... }), "onActorDied"); ``` produce events.onActorDied(fun(Actor actor){})

```c++ struct PlayerEvents {}; struct Events {PlayerEvents playerEvents;}; Events e; chai.add(user_type(), "Events"); chai.add(user_type(), "PlayerEvents"); chai.add_global(var(e), "events"); chai.add(fun(&Events::playerEvents), "player"); chai.add(fun([](PlayerEvents e, function player) { ... }), "onDied"); ``` ```javascript events.player.onDied(fun(Player player){})...

And I will not change the c++ source structure, but may be use the new style( global variable as namespace)

Also if you install it in work profile, it will work fine, the only problem is only one side settings will work... (Aka, if I changed the main profile settings,...

> swc doesn't check the types, includes `@deno-types`. > where you got the error message? aleph dev? ssr mode, since deno check deno-type even in js file...

但是你要知道这些时间是不可能不需要的呀。。。插件的方式决定了必须要有时间加载,不过我觉得可以适当的优化一下用户体验,比如用Toast级别的悬浮View(不需要响应触摸效果,这会比创建Activity更省资源),之类的来提示用户。

Reference: https://en.cppreference.com/w/cpp/atomic/ATOMIC_FLAG_INIT (and in c++20 , just `{}`