Beispiel #1
0
    void Start()
    {
        // Add systems here
        TouchSystem ts = new TouchSystem();

        AddSystem(ts);

        AnimationSystem ans = new AnimationSystem();

        AddSystem(ans);
        UISystem uis = new UISystem();

        AddSystem(uis);
        PauseSystem ps = new PauseSystem();

        AddSystem(ps);
        DestroySystem ds = new DestroySystem();

        AddSystem(ds);

        AdSystem ads = new AdSystem();

        AddSystem(ads);

        Enable();
        ExtraSetup();
    }
Beispiel #2
0
    void when_executing()
    {
        GameEntity e = null;

        before = () =>
        {
            Setup();
            var system = new DestroySystem(_contexts);
            _systems.Add(system);
            e = _contexts.game.CreateEntity();
        };

        it["destroy entities that are flagged as destroyed"] = () =>
        {
            //given
            e.isDestroyed = true;
            //when
            _systems.Execute();
            //then
            e.isEnabled.should_be_false();
            _contexts.game.count.should_be(0);
        };

        it["don't destroy entities that are not flagged as destroyed"] = () =>
        {
            //when
            _systems.Execute();
            //then
            e.isEnabled.should_be_true();
            _contexts.game.count.should_be(1);
        };
    }
    void Start()
    {
        // Add systems here
        DialogSystem dls = new DialogSystem();

        AddSystem(dls);
        PreMatchDialogSystem pmds = new PreMatchDialogSystem();

        AddSystem(pmds);
        MatchSystem ms = new MatchSystem();

        AddSystem(ms);

        AnimationSystem ans = new AnimationSystem();

        AddSystem(ans);
        TouchSystem ts = new TouchSystem();

        AddSystem(ts);
        UISystem uis = new UISystem();

        AddSystem(uis);
        PauseSystem ps = new PauseSystem();

        AddSystem(ps);
        DestroySystem ds = new DestroySystem();

        AddSystem(ds);

        //AdSystem ads = new AdSystem();
        //AddSystem(ads);

        Enable();
        Setup();
    }
        public void Execute(List <Entity> entities)
        {
            foreach (var entity in entities.Where(x => x.hasView))
            {
                DestroySystem.DestroyView(entity);
            }

            foreach (var entity in entities.Where(x => x.hasResource))
            {
                AddView(entity);
            }
        }
    void Start()
    {
        // Add systems here
        LivesSystem ls = new LivesSystem();

        AddSystem(ls);
        StreakSystem ss = new StreakSystem();

        AddSystem(ss);
        ScoreSystem scs = new ScoreSystem();

        AddSystem(scs);
        ColoringSystem cs = new ColoringSystem();

        AddSystem(cs);
        TouchSystem ts = new TouchSystem();

        AddSystem(ts);
        GameSystem gs = new GameSystem();

        AddSystem(gs);
        TutorialSystem tus = new TutorialSystem();

        AddSystem(tus);

        AnimationSystem ans = new AnimationSystem();

        AddSystem(ans);
        UISystem uis = new UISystem();

        AddSystem(uis);
        PauseSystem ps = new PauseSystem();

        AddSystem(ps);
        DestroySystem ds = new DestroySystem();

        AddSystem(ds);

        AdSystem ads = new AdSystem();

        AddSystem(ads);

        Enable();
        this.initializeGame = true;
        ExtraSetup();
    }