Exemple #1
0
        public Timing(IInterpreter <Closure> interpreter, GameState gameState)
        {
            _gameState = gameState;

            interpreter.AddFunction("GetDeltaTime", (Func <float>)GetDeltaTime);
            interpreter.AddFunction("GetTotalTime", (Func <float>)GetTime);
        }
Exemple #2
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 #3
0
        public EventTriggers(IInterpreter <Closure> interpreter, ISignal signal, GameState gameState)
        {
            _interpreter = interpreter;
            _signal      = signal;
            _player      = gameState.Player;

            interpreter.AddFunction("Subscribe", (Action <Table>)CreateEvent);
            interpreter.AddFunction("Notify", (Action <string>)Notify);
        }
Exemple #4
0
        public Player(IInterpreter <Closure> interpreter, GameState gameState)
        {
            _player = gameState.Player;

            interpreter.AddFunction("Lock", (Action)LockMovement);
            interpreter.AddFunction("Unlock", (Action)UnlockMovement);
            interpreter.AddFunction("Flag", (Func <string, bool?, bool>)Flag);
            interpreter.AddFunction("Var", (Func <string, IComparable, object>)Var);
            interpreter.AddFunction("Save", (Action)Save);
        }
Exemple #5
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);
        }
Exemple #6
0
        public Text(IInterpreter <Closure> interpreter, ITextDatabase textDatabase)
        {
            _textDatabase = textDatabase;

            interpreter.AddFunction("Text", (Func <string, string>)GetText);
        }