Exemple #1
0
            public World ToImmutable()
            {
                if (!_anythingChanged)
                {
                    return(_previousWorld);
                }

                foreach (long entityID in _addedEntities)
                {
                    if (!_previousWorld._entities.ContainsKey(entityID))
                    {
                        var entity = _entities[entityID];
                        _entities.Remove(entityID);
                        var resultingEntity = _systemManager.Load(entity);
                        if (resultingEntity != null)
                        {
                            _entities.Add(entityID, resultingEntity);
                        }
                    }
                }

                foreach (Entity entity in _removedEntities)
                {
                    _systemManager.Unload(entity);
                }

                return(new World(_entities.ToImmutable(), _systemManager));
            }
Exemple #2
0
        protected override void UnloadContent()
        {
            _systemManager.Unload();

            _gameScope.Dispose();

            base.UnloadContent();
        }