Ejemplo n.º 1
0
 private void CheckBindings(ISimStatsType stats, ISimConfigType config)
 {
     if (stats == null)
     {
         throw new NullReferenceException(nameof(ISimStatsType));
     }
     if (config == null)
     {
         throw new NullReferenceException(nameof(ISimConfigType));
     }
 }
Ejemplo n.º 2
0
        public void Bind(ISimStatsType stats, ISimConfigType config)
        {
            if (_binded)
            {
                return;
            }

            CheckBindings(stats, config);

            config.Config.OnChanged += cfg => _simAreaSize = new Vector2(cfg.gameAreaWidth, cfg.gameAreaHeight);
            stats.State.OnChanged   += SetupOnState;

            _binded = true;
        }
Ejemplo n.º 3
0
        public void Bind(ISimStatsType stats, ISimConfigType config)
        {
            if (_binded)
            {
                return;
            }

            CheckBindings(stats, config);

            config.Config.OnChanged += cfg => _config = cfg;
            stats.State.OnChanged   += OnPublicStateChanged;
            ViewState.OnChanged     += OnViewStateChanged;

            _publicState = stats.State;

            _binded = true;
        }