1
This commit is contained in:
parent
968587770e
commit
ea27f62b4a
@ -2,6 +2,35 @@
|
||||
|
||||
#include "lispenv.h"
|
||||
|
||||
class SkillScope : public a8::lisp::GlobalScope
|
||||
{
|
||||
public:
|
||||
|
||||
void Init()
|
||||
{
|
||||
RegisterCProc
|
||||
(
|
||||
"${skillNumber.speed}",
|
||||
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
|
||||
{
|
||||
a8::lisp::Atom result;
|
||||
return std::make_shared<a8::lisp::Value>(result);
|
||||
});
|
||||
}
|
||||
|
||||
float Eval(std::shared_ptr<a8::lisp::Value> expr,
|
||||
Creature* c,
|
||||
const mt::Skill* skill_meta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
struct {
|
||||
Creature* c = nullptr;
|
||||
const mt::Skill* skill_meta = nullptr;
|
||||
} context_;
|
||||
};
|
||||
|
||||
void LispEnv::Init()
|
||||
{
|
||||
|
||||
@ -21,5 +50,5 @@ float LispEnv::EvalSkillNumberExpr(std::shared_ptr<a8::lisp::Value> expr,
|
||||
Creature* c,
|
||||
const mt::Skill* skill_meta)
|
||||
{
|
||||
|
||||
return skill_env_->Eval(expr, c, skill_meta);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <a8/lisp.h>
|
||||
|
||||
class Creature;
|
||||
class SkillScope;
|
||||
class LispEnv : public a8::Singleton<LispEnv>
|
||||
{
|
||||
|
||||
@ -23,5 +24,5 @@ class LispEnv : public a8::Singleton<LispEnv>
|
||||
|
||||
private:
|
||||
|
||||
std::shared_ptr<a8::lisp::GlobalScope> skill_env_;
|
||||
std::shared_ptr<SkillScope> skill_env_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user