Esempio n. 1
0
        public ISequenceCache LoadSequenceCacheFile(string filePath)
        {
            filePath = _GetRootedPath(filePath, SequenceService.SequenceDirectory);
            IObjectLoader loader = LoaderFactory.Instance.CreateSequenceCacheLoader();

            return((ISequenceCache)loader.LoadFromFile(filePath));
        }
Esempio n. 2
0
        private object[] _deserializedData; // only used for deserialization

        public DataManager(
            ClientTransaction clientTransaction,
            IClientTransactionEventSink transactionEventSink,
            IDataContainerEventListener dataContainerEventListener,
            IInvalidDomainObjectManager invalidDomainObjectManager,
            IObjectLoader objectLoader,
            IRelationEndPointManager relationEndPointManager)
        {
            ArgumentUtility.CheckNotNull("clientTransaction", clientTransaction);
            ArgumentUtility.CheckNotNull("transactionEventSink", transactionEventSink);
            ArgumentUtility.CheckNotNull("dataContainerEventListener", dataContainerEventListener);
            ArgumentUtility.CheckNotNull("invalidDomainObjectManager", invalidDomainObjectManager);
            ArgumentUtility.CheckNotNull("objectLoader", objectLoader);
            ArgumentUtility.CheckNotNull("relationEndPointManager", relationEndPointManager);

            _clientTransaction          = clientTransaction;
            _transactionEventSink       = transactionEventSink;
            _dataContainerEventListener = dataContainerEventListener;
            _invalidDomainObjectManager = invalidDomainObjectManager;
            _objectLoader            = objectLoader;
            _relationEndPointManager = relationEndPointManager;

            _dataContainerMap       = new DataContainerMap(_transactionEventSink);
            _domainObjectStateCache = new DomainObjectStateCache(clientTransaction);
        }
Esempio n. 3
0
        public override void SetUp()
        {
            base.SetUp();

            _persistenceStrategyMock      = MockRepository.GenerateStrictMock <IPersistenceStrategy> ();
            _objectLoaderMock             = MockRepository.GenerateStrictMock <IObjectLoader> ();
            _transactionEventSinkWithMock = MockRepository.GenerateStrictMock <IClientTransactionEventSink>();

            _queryManager = new QueryManager(
                _persistenceStrategyMock,
                _objectLoaderMock,
                _transactionEventSinkWithMock);

            _collectionQuery = QueryFactory.CreateQueryFromConfiguration("OrderQuery");
            _scalarQuery     = QueryFactory.CreateQueryFromConfiguration("OrderNoSumByCustomerNameQuery");
            _customQuery     = QueryFactory.CreateQueryFromConfiguration("CustomQuery");

            _fakeOrder1 = DomainObjectMother.CreateFakeObject <Order> ();
            _fakeOrder2 = DomainObjectMother.CreateFakeObject <Order>();

            _loadedObjectDataStub1 = MockRepository.GenerateStub <ILoadedObjectData> ();
            _loadedObjectDataStub2 = MockRepository.GenerateStub <ILoadedObjectData> ();

            _rowConversion = qrr => qrr.GetRawValue(0);
        }
Esempio n. 4
0
 public AssetBundlesStorage(IObjectLoader objectLoader, ICoroutiner coroutiner)
 {
     _coroutiner   = coroutiner;
     _objectLoader = objectLoader;
     LoadAssets();
     // _coroutiner.StartCoroutine(DownloadAssetsAndCache());
 }
Esempio n. 5
0
        public GameManager(IPublisher publisher, IAssetBundlesStorage assetBundlesStorage, IObjectLoader objectLoader,
                           IConfigurationTool configurationTool)
        {
            _publisher           = publisher;
            _assetBundlesStorage = assetBundlesStorage;
            _objectLoader        = objectLoader;
            _configurationTool   = configurationTool;

            Initialization();
        }
Esempio n. 6
0
    private void Initialization()
    {
        _objectLoader        = new ObjectLoader();
        _publisher           = new Publisher();
        _configurationTool   = new ConfigurationTool(_objectLoader, _folder);
        _assetBundlesStorage = new AssetBundlesStorage(_objectLoader, _coroutiner);
        _gameManager         = new GameManager(_publisher, _assetBundlesStorage, _objectLoader, _configurationTool);

        _clickHandler.SetDependence(_publisher);
    }
        // construction and disposing

        /// <summary>
        /// Initializes a new instance of the <see cref="QueryManager"/> class.
        /// </summary>
        /// <param name="persistenceStrategy">The <see cref="IPersistenceStrategy"/> used to load query results not involving <see cref="DomainObject"/> instances.</param>
        /// <param name="objectLoader">An <see cref="IObjectLoader"/> implementation that can be used to load objects. This parameter determines
        ///   the <see cref="ClientTransaction"/> housing the objects loaded by queries.</param>
        /// <param name="transactionEventSink">The transaction event sink to use for raising query-related notifications.</param>
        public QueryManager(
            IPersistenceStrategy persistenceStrategy,
            IObjectLoader objectLoader,
            IClientTransactionEventSink transactionEventSink)
        {
            ArgumentUtility.CheckNotNull("persistenceStrategy", persistenceStrategy);
            ArgumentUtility.CheckNotNull("objectLoader", objectLoader);
            ArgumentUtility.CheckNotNull("transactionEventSink", transactionEventSink);

            _persistenceStrategy  = persistenceStrategy;
            _objectLoader         = objectLoader;
            _transactionEventSink = transactionEventSink;
        }
Esempio n. 8
0
 public ObjectStorage(IObjectLoader objectLoader, IConfigurateManager configurateManager)
 {
     _objectLoader       = objectLoader;
     _configurateManager = configurateManager;
     _poolPrefabs        = new Dictionary <ObjectTypeEnum, object>();
     _poolsDataObjects   = new Dictionary <ObjectTypeEnum, object[]>();
     _poolsObjects       = new Dictionary <ObjectTypeEnum, List <GameObject> >();
     _dictCards          = new Dictionary <SubTypeCard, IDictionary <string, ICard> >();
     _audioClips         = new Dictionary <string, AudioClip>();
     _adventure          = new List <Adventure>();
     _tokens             = new List <IToken>();
     CreateDictionaryAudio();
 }
Esempio n. 9
0
        void IDeserializationCallback.OnDeserialization(object sender)
        {
            var doInfo = new FlattenedDeserializationInfo(_deserializedData);

            _clientTransaction          = doInfo.GetValueForHandle <ClientTransaction> ();
            _transactionEventSink       = doInfo.GetValueForHandle <IClientTransactionEventSink> ();
            _dataContainerEventListener = doInfo.GetValueForHandle <IDataContainerEventListener> ();
            _dataContainerMap           = doInfo.GetValue <DataContainerMap>();
            _relationEndPointManager    = doInfo.GetValueForHandle <RelationEndPointManager>();
            _domainObjectStateCache     = doInfo.GetValue <DomainObjectStateCache>();
            _invalidDomainObjectManager = doInfo.GetValue <IInvalidDomainObjectManager> ();
            _objectLoader = doInfo.GetValueForHandle <IObjectLoader>();

            _deserializedData = null;
            doInfo.SignalDeserializationFinished();
        }
Esempio n. 10
0
        public ElementNodeTemplate LoadElementNodeTemplateFile(string filePath)
        {
            IObjectLoader <ElementNodeTemplate> loader = LoaderFactory.Instance.CreateElementNodeTemplateLoader();

            return(loader.LoadFromFile(filePath));
        }
Esempio n. 11
0
        public Program LoadProgramFile(string filePath)
        {
            IObjectLoader <Program> loader = LoaderFactory.Instance.CreateProgramLoader();

            return(loader.LoadFromFile(filePath));
        }
Esempio n. 12
0
        public SystemContext LoadSystemContextFile(string filePath)
        {
            IObjectLoader <SystemContext> loader = LoaderFactory.Instance.CreateSystemContextLoader();

            return(loader.LoadFromFile(filePath));
        }
Esempio n. 13
0
        public ModuleStore LoadModuleStoreFile(string filePath)
        {
            IObjectLoader <ModuleStore> loader = LoaderFactory.Instance.CreateModuleStoreLoader();

            return(loader.LoadFromFile(filePath));
        }
Esempio n. 14
0
    void Start()
   {
       _publisher = new Publisher();

       _saveManager = new SaveManager();
       _animaManager = new AnimaManager();
       _objectLoader = new ObjectLoader();
       _configurateManager = new ConfigurateManager();

       _objectStorage = new ObjectStorage(_objectLoader,_configurateManager);
       _tokenRewardManager = new TokenRewardManager(_publisher, _animaManager, _objectStorage,_configurateManager);
       _audioManager = new AudioManager(_objectStorage, _coroutiner);
       _barsPlayerManager = new BarsPlayerManager(_objectStorage);

       _inventoryManager = new InventoryManager(_objectStorage, _publisher, _coroutiner,_configurateManager);
       
       _gameStageManager = new GameStageManager(_publisher, _coroutiner);
       _gameManager = new GameManager(_publisher, _animaManager, _objectStorage, _coroutiner,_inventoryManager,_configurateManager);
       _enemyManager = new EnemyManager(_publisher, _coroutiner,_animaManager,_objectStorage, _configurateManager);
       _alliesManager = new AlliesManager(_coroutiner, _configurateManager);
       _playersManager = new PlayersManager(_publisher,_animaManager, _tokenRewardManager);
       _barsEnemyManager = new BarsEnemyManager(_enemyManager, _publisher);
       _activateCardManager = new ActivateCardManager(_publisher, _barsPlayerManager,_enemyManager);
       _targetManager = new TargetManager(_publisher, _animaManager, _activateCardManager, _enemyManager);
       _deckManager = new DeckManager(_objectStorage,_inventoryManager,_animaManager,_publisher,_coroutiner, _targetManager,_configurateManager);
       
       _popupEvent = new PopupEvent(_objectStorage,_publisher,_animaManager,_coroutiner, _configurateManager);
       _popupGameMenu = new PopupGameMenu(_objectStorage, _publisher, _animaManager,_coroutiner);
       _popupInventory = new PopupInventory(_inventoryManager, _animaManager);
       _popupPlaceInSlot = new PopupPlaceInSlot(_publisher);
       _popupPlayers = new PopupPlayers(_animaManager, _objectStorage, _publisher, _configurateManager);
       //_descriptionCardPopup = new PopupDescriptionCard(_popupDescriptionCard);
       _popupDescriptionCard = new PopupDescriptionCard(_coroutiner,_animaManager);
       _popupRewardEvent = new PopupRewardEvent(_publisher, _objectStorage, _configurateManager, _coroutiner);
       
       _publisher.AddSubscriber((ISubscriber) _gameManager);
       _publisher.AddSubscriber((ISubscriber) _inventoryManager);
       _publisher.AddSubscriber((ISubscriber) _gameStageManager);
       _publisher.AddSubscriber((ISubscriber) _activateCardManager);
       _publisher.AddSubscriber((ISubscriber) _barsPlayerManager);
       _publisher.AddSubscriber((ISubscriber) _barsEnemyManager);
       _publisher.AddSubscriber((ISubscriber) _enemyManager);
       _publisher.AddSubscriber((ISubscriber) _alliesManager);
       _publisher.AddSubscriber((ISubscriber) _playersManager);
       _publisher.AddSubscriber((ISubscriber) _deckManager);
       _publisher.AddSubscriber((ISubscriber) _targetManager);
       _publisher.AddSubscriber((ISubscriber) _audioManager);
       _publisher.AddSubscriber((ISubscriber) _tokenRewardManager);
       
       _publisher.AddSubscriber((ISubscriber) _popupGameMenu);
       _publisher.AddSubscriber((ISubscriber) _popupInventory);
       _publisher.AddSubscriber((ISubscriber) _popupEvent);
       _publisher.AddSubscriber((ISubscriber) _popupPlayers);
       _publisher.AddSubscriber((ISubscriber) _popupDescriptionCard);
       _publisher.AddSubscriber((ISubscriber) _popupRewardEvent);
       _publisher.AddSubscriber((ISubscriber) _popupPlaceInSlot);
       
       _baseManagers = new BaseManagers(_saveManager,_animaManager,_publisher,_objectStorage,_configurateManager,_coroutiner, _audioManager);
       _gameManagers = new GameManagers(_gameManager, _activateCardManager, _barsPlayerManager, _barsEnemyManager, 
           _enemyManager, _alliesManager,  _playersManager, _deckManager, _inventoryManager, _targetManager, _tokenRewardManager);
       _popupManagers = new PopupManagers(_popupGameMenu,_popupInventory, _popupEvent, _popupPlayers, _popupDescriptionCard,_popupPlaceInSlot, _popupRewardEvent);
       
       
       _logicManager = new LogicManager(_baseManagers,_gameManagers, _popupManagers);
       _loadManager = new LoadManager(_logicManager);
       //-------------------Делаем переход в сцену "Меню"
       _loadManager.Navigate(SceneTypeEnum.Bootstrapper, SceneTypeEnum.Menu, CustomObject.Empty);
   }
Esempio n. 15
0
 public CountingObjectLoaderDecorator(IObjectLoader decorated)
 {
     _decorated = decorated;
 }
Esempio n. 16
0
 public ConfigurationTool(IObjectLoader objectLoader, Transform folder)
 {
     _objectLoader = objectLoader;
     _folder       = folder;
 }