Exemple #1
0
        public EventConditions(IInterpreter <Closure> interpreter, GameState gameState)
        {
            _player = gameState.Player;

            interpreter.AddFunction("_FlagCondition", (Func <string, bool, bool>)CheckFlag);
            interpreter.AddFunction("_VarCondition", (Func <string, Equality, object, bool>)CheckVariable);
            interpreter.AddType <Equality>("Equality");
        }
Exemple #2
0
        public GameObject(IInterpreter <Closure> interpreter, GameState gameState, Stage stage)
        {
            _gameState = gameState;
            _stage     = stage;

            interpreter.AddFunction("Player", (Func <string>)GetPlayer);
            interpreter.AddFunction("GameObject", (Func <string, string>)GetGameObjectByName);
            interpreter.AddFunction("GameObjectsByTag", (Func <string, IEnumerable <string> >)GetGameObjectsByTag);

            interpreter.AddFunction("_Move", (Func <string, Vector2, float, bool>)Move);

            interpreter.AddType <Vector2>("Vector2");
            interpreter.RegisterGlobal("Vector2", (Func <float, float, Vector2>)CreateVector2);

            interpreter.AddFunction("Warp", (Action <string, Vector2>)Warp);
        }