Exemplo n.º 1
0
 public void SetPool(Pool pool)
 {
     Random.seed = 42;
     _pool = pool;
     _group = pool.GetGroup(Matcher.BonusModel);
     _players = pool.GetGroup(Matcher.Player);
 }
Exemplo n.º 2
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.Input);
     players = pool.GetGroup(Matcher.Player);
     slowGame = pool.GetGroup(Matcher.SlowGame);
 }
Exemplo n.º 3
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.Score);
     time = pool.GetGroup(Matcher.Time);
     enemies = pool.GetGroup(Matcher.EnemiesModel);
 }
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _asteroids = pool.GetGroup(Matcher.Asteroid);
     _levels = pool.GetGroup(Matcher.Level);
     _players = pool.GetGroup(Matcher.Player);
 }
Exemplo n.º 5
0
 public void SetPool(Pool pool)
 {
     group = pool.GetGroup(Matcher.WaveSpawner);
     time = pool.GetGroup(Matcher.Time);
     camera = pool.GetGroup(Matcher.Camera);
     enemyFactory = pool.GetGroup(Matcher.EnemyFactory);
 }
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     this.pool.GetGroup(Matcher.SettingsModel).OnEntityUpdated += update;
     group = pool.GetGroup(Matcher.DifficultyController);
     difficulties = pool.GetGroup(Matcher.DifficultyModel);
 }
Exemplo n.º 7
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.FirstBoss);
     time = pool.GetGroup(Matcher.Time);
     createStages();
 }
Exemplo n.º 8
0
 public void SetPool(Pool pool)
 {
     group = pool.GetGroup(Matcher.AllOf(Matcher.PlayerScore, Matcher.GameObject));
     killInfo = pool.GetGroup(Matcher.AllOf(Matcher.KillInfo, Matcher.GameObject));
     score = pool.GetGroup(Matcher.Score);
     translation = pool.GetGroup(Matcher.TranslationService);
 }
Exemplo n.º 9
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _camera = _pool.GetGroup(Matcher.Camera);
     _time = _pool.GetGroup(Matcher.Time);
     _group = pool.GetGroup(Matcher.AllOf(Matcher.Path, Matcher.GameObject, Matcher.Velocity, Matcher.VelocityLimit, Matcher.Position));
 }
Exemplo n.º 10
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.EnemySpawner);
     camera = pool.GetGroup(Matcher.Camera);
     enemyFactory = pool.GetGroup(Matcher.EnemyFactory);
 }
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _pool.GetGroup(Matcher.SettingsModel).OnEntityUpdated += update;
     _group = pool.GetGroup(Matcher.DifficultyController);
     _models = pool.GetGroup(Matcher.DifficultyModel);
 }
Exemplo n.º 12
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _group = _pool.GetGroup(Matcher.Input);
     _players = _pool.GetGroup(Matcher.Player);
     _camera = _pool.GetGroup(Matcher.Camera);
     _slowGame = _pool.GetGroup(Matcher.SlowGame);
 }
Exemplo n.º 13
0
 public void SetPool(Pool pool)
 {
     Random.seed = 42;
     this.pool = pool;
     group = pool.GetGroup(Matcher.BonusModel);
     players = pool.GetGroup(Matcher.Player);
     currentShip = pool.GetGroup(Matcher.CurrentShip);
 }
Exemplo n.º 14
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _player = pool.GetGroup(Matcher.Player);
     _time = pool.GetGroup(Matcher.Time);
     _group = pool.GetGroup(Matcher.SpeedBonus);
     _eventService = pool.GetGroup(Matcher.EventService);
 }
Exemplo n.º 15
0
 public void SetPool(Pool pool)
 {
     _grid = pool.GetGroup(Matcher.Grid);
     _time = pool.GetGroup(Matcher.Time);
     _group = pool.GetGroup(Matcher.AllOf(Matcher.GridField, Matcher.Position));
     pool.GetGroup(Matcher.Path).OnEntityRemoved += onEntityPathRemoved;
     pool.GetGroup(Matcher.GridField).OnEntityRemoved += onEntityGridRemoved;
 }
Exemplo n.º 16
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _playerGroup = pool.GetGroup(Matcher.Player);
     _timeGroup = pool.GetGroup(Matcher.Time);
     _pause = pool.GetGroup(Matcher.PauseGame);
     _settings = pool.GetGroup(Matcher.SettingsModel);
 }
Exemplo n.º 17
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.BonusModel);
     currentShip = pool.GetGroup(Matcher.CurrentShip);
     player = pool.GetGroup(Matcher.Player);
     shipBonus = pool.GetGroup(Matcher.ShipBonus);
 }
Exemplo n.º 18
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _missiles = _pool.GetGroup(Matcher.HomeMissileSpawner);
     _time = pool.GetGroup(Matcher.Time);
     _enemies = pool.GetGroup(Matcher.Enemy);
     _player = pool.GetGroup(Matcher.Player);
 }
Exemplo n.º 19
0
 public void SetPool(Pool pool)
 {
     this.pool = pool;
     group = pool.GetGroup(Matcher.LaserSpawner);
     time = pool.GetGroup(Matcher.Time);
     enemyLayerMask = (1 << LayerMask.NameToLayer("Enemy")) | (1 << LayerMask.NameToLayer("Static"));
     playerLayerMask = (1 << LayerMask.NameToLayer("Player")) | (1 << LayerMask.NameToLayer("Static"));
 }
Exemplo n.º 20
0
 public void SetPool(Pool pool)
 {
     Init(pool);
     _createLevels = pool.GetGroup(Matcher.CreateLevel);
     _players = pool.GetGroup(Matcher.Player);
     _pause = pool.GetGroup(Matcher.PauseGame);
     _blockade = pool.GetGroup(Matcher.MovingBlockade);
 }
Exemplo n.º 21
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _group = pool.GetGroup(Matcher.FirstBoss);
     _time = _pool.GetGroup(Matcher.Time);
     _player = pool.GetGroup(Matcher.Player);
     _camera = pool.GetGroup(Matcher.Camera);
 }
Exemplo n.º 22
0
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _group = pool.GetGroup(Matcher.EnemySpawner);
     _camera = pool.GetGroup(Matcher.Camera);
     _difficulty = pool.GetGroup(Matcher.DifficultyController);
     _factory = new EnemyFactory();
     _factory.SetPool(_pool);
 }
 public void SetPool(Pool pool)
 {
     _pool = pool;
     _pool.GetGroup(Matcher.SpaceshipDeathroes).OnEntityRemoved += OnDeaththroesRemoved;
     _waiting = _pool.GetGroup(Matcher.AllOf(Matcher.WaitingForSpace, Matcher.Spaceship));
     _asteroids = pool.GetGroup(Matcher.AllOf(Matcher.Asteroid, Matcher.CollisionRadius));
     _games = _pool.GetGroup(Matcher.AllOf(Matcher.Game, Matcher.Bounds));
     _lives = _pool.GetGroup(Matcher.Lives);
 }
Exemplo n.º 24
0
	public void SetPool(Pool pool)
	{
		_pool = pool;
		_inputStringGroup = pool.GetGroup(Matcher.InputString);
		_leaderboardGroup = pool.GetGroup(Matcher.AllOf(Matcher.Leaderboard, Matcher.View));
		_leaderboardGroup.OnEntityAdded += (group, entity, index, component) => {
			entity.view.gameObject.transform.Find("HighScores").GetComponent<GUIText>().text = "Highscore\nusername:\n" + entity.leaderboard.userName.ToUpper().PadRight(3, '_');
		};
	}
        static void groupExample(Pool pool) {
            pool.GetGroup(Matcher.Position).GetEntities();

            // ----------------------------

            pool.GetGroup(Matcher.Position).OnEntityAdded += (group, entity) => {
                // Do something
            };
        }
Exemplo n.º 26
0
 public void SetPool(Pool pool)
 {
     paths = pool.GetGroup(Matcher.PathsModel);
     enemies = pool.GetGroup(Matcher.EnemiesModel);
     difficulty = pool.GetGroup(Matcher.DifficultyController);
     enemyCreator = new EnemyCreator(pool);
     bossCreator = new BossCreator(pool);
     weaponProvider = new WeaponProvider();
     Random.seed = pool.count;
 }
Exemplo n.º 27
0
        public void Start()
        {
            pool = Pools.pool;

            pool.GetGroup(EntitysToBeViewed).OnEntityAdded += (group, entity, index, component) => OnEntityAdded(entity);

            pool.GetGroup(EntitysToBeViewed).OnEntityRemoved +=
                (group, entity, index, component) => OnEntityRemoved(entity);

            pool.GetGroup(Matcher.GameState).OnEntityAdded +=
                (group, entity, index, component) => OnGameStateUpdated(entity.gameState.GameState);

            tableContents = new Dictionary<int, GameObject>();
        }
    void ISetPool.SetPool(Pool pool)
    {
        this.pool = pool;

        var gameBoard = pool.GetGroup(Matcher.GameBoard);
        gameBoard.OnEntityAdded += (group, entity, index, component) =>
            CreateNewGameBoardCache((GameBoardComponent)component);
        gameBoard.OnEntityUpdated += (group, entity, index, previousComponent, newComponent) =>
            CreateNewGameBoardCache((GameBoardComponent)newComponent);

        var gameBoardElements = pool.GetGroup(Matcher.AllOf(Matcher.GameBoardElement, Matcher.Position));
        gameBoardElements.OnEntityAdded += OnGameBoardElementAdded;
        gameBoardElements.OnEntityUpdated += OnGameBoardElementUpdated;
        gameBoardElements.OnEntityRemoved += OnGameBoardElementRemoved;
    }
Exemplo n.º 29
0
        ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, TriggerOnEvent[] triggers)
        {
            _subsystem = subSystem;
            var ensureComponents = subSystem as IEnsureComponents;
            if (ensureComponents != null) {
                _ensureComponents = ensureComponents.ensureComponents;
            }
            var excludeComponents = subSystem as IExcludeComponents;
            if (excludeComponents != null) {
                _excludeComponents = excludeComponents.excludeComponents;
            }

            _clearAfterExecute = (subSystem as IClearReactiveSystem) != null;

            var triggersLength = triggers.Length;
            var groups = new Group[triggersLength];
            var eventTypes = new GroupEventType[triggersLength];
            for (int i = 0; i < triggersLength; i++) {
                var trigger = triggers[i];
                groups[i] = pool.GetGroup(trigger.trigger);
                eventTypes[i] = trigger.eventType;
            }
            _observer = new GroupObserver(groups, eventTypes);
            _buffer = new List<Entity>();
        }
Exemplo n.º 30
0
        ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, TriggerOnEvent[] triggers)
        {
            _subsystem = subSystem;
            var ensureComponents = subSystem as IEnsureComponents;

            if (ensureComponents != null)
            {
                _ensureComponents = ensureComponents.ensureComponents;
            }
            var excludeComponents = subSystem as IExcludeComponents;

            if (excludeComponents != null)
            {
                _excludeComponents = excludeComponents.excludeComponents;
            }

            _clearAfterExecute = (subSystem as IClearReactiveSystem) != null;

            var triggersLength = triggers.Length;
            var groups         = new Group[triggersLength];
            var eventTypes     = new GroupEventType[triggersLength];

            for (int i = 0; i < triggersLength; i++)
            {
                var trigger = triggers[i];
                groups[i]     = pool.GetGroup(trigger.trigger);
                eventTypes[i] = trigger.eventType;
            }
            _observer = new GroupObserver(groups, eventTypes);
            _buffer   = new List <Entity>();
        }
    // Use awake to ensure that this fires before the systems boot
    // otherwise it misses the initial level set
    void Awake()
    {
        levelImage = GetComponent<Image>();

        pool = Pools.pool;
        pool.GetGroup(Matcher.Level).OnEntityAdded += (group, entity, index, component) =>
        {
            currentLevel = pool.level.level;
            pool.isLevelTransitionDelay = true;
            Invoke("ShowLevelImage", displayDelay);
        };
        pool.GetGroup(Matcher.GameOver).OnEntityAdded += (group, entity, index, component) =>
        {
            GameOver();
        };
    }
Exemplo n.º 32
0
        ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, IMatcher[] triggers, GroupEventType[] eventTypes)
        {
            _subsystem = subSystem;
            var groups = new Group[triggers.Length];

            for (int i = 0, triggersLength = triggers.Length; i < triggersLength; i++)
            {
                groups[i] = pool.GetGroup(triggers[i]);
            }
            _observer = new GroupObserver(groups, eventTypes);
            _buffer   = new List <Entity>();
        }
Exemplo n.º 33
0
        static GroupObserver createGroupObserver(Pool pool, TriggerOnEvent[] triggers)
        {
            var triggersLength = triggers.Length;
            var groups         = new Group[triggersLength];
            var eventTypes     = new GroupEventType[triggersLength];

            for (int i = 0; i < triggersLength; i++)
            {
                var trigger = triggers[i];
                groups[i]     = pool.GetGroup(trigger.trigger);
                eventTypes[i] = trigger.eventType;
            }

            return(new GroupObserver(groups, eventTypes));
        }
Exemplo n.º 34
0
        ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, IMatcher[] triggers, GroupEventType[] eventTypes)
        {
            _subsystem = subSystem;
            var ensureComponents = subSystem as IEnsureComponents;

            if (ensureComponents != null)
            {
                _ensureComponents = ensureComponents.ensureComponents;
            }
            var excludeComponents = subSystem as IExcludeComponents;

            if (excludeComponents != null)
            {
                _excludeComponents = excludeComponents.excludeComponents;
            }
            var groups = new Group[triggers.Length];

            for (int i = 0, triggersLength = triggers.Length; i < triggersLength; i++)
            {
                groups[i] = pool.GetGroup(triggers[i]);
            }
            _observer = new GroupObserver(groups, eventTypes);
            _buffer   = new List <Entity>();
        }
Exemplo n.º 35
0
 public static Entity[] GetEntities(this Pool pool, IMatcher matcher)
 {
     return(pool.GetGroup(matcher).GetEntities());
 }
Exemplo n.º 36
0
 public ReactiveSystem(Pool pool, IReactiveSystem subSystem)
 {
     _subsystem = subSystem;
     _observer  = new GroupObserver(pool.GetGroup(subSystem.trigger), subSystem.eventType);
     _buffer    = new List <Entity>();
 }