예제 #1
0
파일: Timing.cs 프로젝트: CarimA/RPG
        public Timing(IInterpreter <Closure> interpreter, GameState gameState)
        {
            _gameState = gameState;

            interpreter.AddFunction("GetDeltaTime", (Func <float>)GetDeltaTime);
            interpreter.AddFunction("GetTotalTime", (Func <float>)GetTime);
        }
예제 #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");
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #6
0
파일: Text.cs 프로젝트: CarimA/RPG
        public Text(IInterpreter <Closure> interpreter, ITextDatabase textDatabase)
        {
            _textDatabase = textDatabase;

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