Example #1
0
    public void Execute()
    {
        if (Target != null)
        {
            var sequence = new CommandSequence();

            IAction action = Events.Prepare <GoTinyAction>();
            action.Configure(Target);
            sequence.Add(action);

            action = Events.Prepare <ColorCycleAction>();
            action.Configure(Target);
            sequence.Add(action);

            action = Events.Prepare <GoTinyAction>();
            action.Configure(Target);
            sequence.Add(action);

            sequence.OnCompleted((ep) => { this.Completed(); });
            sequence.Execute();
        }
        else
        {
            this.Completed();
        }
    }
Example #2
0
        protected override void OnEnter()
        {
            BattleInfo.Clear();
            BattleInfo.userId = 1;
            GameObjectPool.Instance.Clear();
            ViewSys.Instance.Open("LoadingView");
            m_cJoinSequence = new CommandSequence();
            var cmdConnectBattleServer = new Cmd_ConnectBattleServer();
            var cmdLoadScene           = new Cmd_LoadScene();

            cmdLoadScene.On_Done += OnLoadSceneDone;
            m_cJoinSequence.AddSubCommand(cmdConnectBattleServer);
            m_cJoinSequence.AddSubCommand(cmdLoadScene);
            m_cJoinSequence.On_Done += OnJoinScene;
            GameInContext context = new GameInContext();

            context.sceneId = GameConst.Instance.GetInt("default_scene_id");
            m_cJoinSequence.Execute(context);
        }
    public static void Main()
    {
        MachineComposite dublin = ExampleMachine.Dublin();
        ShellAssembler   sa     = (ShellAssembler)dublin.Find("ShellAssembler:3302");
        StarPress        sp     = (StarPress)dublin.Find("StarPress:3404");
        UnloadBuffer     ub     = (UnloadBuffer)dublin.Find("UnloadBuffer:3501");

        sa.Load(new Bin(11011));
        sp.Load(new Bin(11015));

        CarryCommand c1 = new CarryCommand(sa, ub);
        CarryCommand c2 = new CarryCommand(sp, ub);

        CommandSequence seq = new CommandSequence();

        seq.AddCommand(c1);
        seq.AddCommand(c2);

        seq.Execute();
    }
Example #4
0
    private void Init()
    {
        DontDestroyOnLoad(gameObject);

        if (!File.Exists(_config.UserRepositoryPath))
        {
            _newGame = true;
        }

        //catalog = new CatalogRepository(new JsonDbProxy(CatalogPath, "catalog"));
        //userRepository = new UserRepository(new JsonDbProxy(UserRepositoryPath, "catalog"));

        CommandSequence sequence = new CommandSequence(
            new InitDataCommand(catalog),
            new InitDataCommand(userRepository)
            );

        sequence.OnComplete += OnInitComplete;
        sequence.Execute();
    }