Exemple #1
0
 public HostWaitState(IStateManager manager, DroughtGame game)
     : base(manager, game)
 {
     stateManager = manager;
     networkManager = game.getNetworkManager();
     loadContent();
 }
 public virtual void DetectChanges(IStateManager stateManager)
 {
     foreach (var entry in stateManager.Entries.Where(e => e.EntityState != EntityState.Detached).ToList())
     {
         DetectChanges(entry);
     }
 }
 public QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IKeyValueFactorySource keyValueFactorySource)
 {
     _stateManager = stateManager;
     _keyValueFactorySource = keyValueFactorySource;
 }
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector)
 {
     _stateManager = stateManager;
     _changeDetector = changeDetector;
 }
 public WizardPagerAdapter(FragmentManager fragmentManager, WizardFlow wizardFlow, IStateManager stateManager, Wizard wizard)
     : base(fragmentManager)
 {
     WizardFlow = wizardFlow;
     StateManager = stateManager;
     Wizard = wizard;
 }
Exemple #6
0
        public Holodeck()
        {
            var gdm = new GraphicsDeviceManager(this);
            gdm.SynchronizeWithVerticalRetrace = false;
            #if XBOX
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 720;
            gdm.PreferredBackBufferWidth = 1280;
            #elif WINDOWS_PHONE
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 800;
            gdm.PreferredBackBufferWidth = 400;
            #endif

            this.IsFixedTimeStep = false;
            TaskManager.IsThreadingEnabled = false;

            _viewManager = new ViewManager(this);
            _inputManager = new InputManager(this);
            _stateManager = new StateManager(this);
            _physics = new PhysicsManager(this);
            this.Components.Add(new PhysicsScene(this, _physics));

            Content.RootDirectory = "Content";
        }
 public virtual void DetectChanges(IStateManager stateManager)
 {
     foreach (var entry in stateManager.Entries.ToList())
     {
         DetectChanges(entry);
     }
 }
 public EntityEntryGraphIterator(
     [NotNull] DbContext context,
     [NotNull] IStateManager stateManager)
 {
     _context = context;
     _stateManager = stateManager;
 }
        public FreeLookState(IStateManager stateManager)
            : base(stateManager)
        {
            _camera = (IViewManager)stateManager.Game.Services.GetService(typeof(IViewManager));
            _input = (IInputManager)stateManager.Game.Services.GetService(typeof(IInputManager));

            _input.CaptureMouse = true;
        }
 public GameEngine(IBasicIOProvider provider)
 {
     this.provider = provider;
     this.numberOfMoves = new Mover();
     this.stateManager = new StateManager();
     this.settingMatrixSize = new MatrixSizeSetter();
     this.player = new Player();
 }
        /// <inheritdoc />
        public override InternalEntityEntry Create(IStateManager stateManager, IEntityType entityType, object entity, ValueBuffer valueBuffer)
        {
            var entry = base.Create(stateManager, entityType, entity, valueBuffer);

            BindMixins(entry, entityType, entity);

            return entry;
        }
        public CoreModule(IShell shell, IStateManager stateManager, IMainWindow mainWindow)
        {
            this.shell = shell;
            this.stateManager = stateManager;
            this.mainWindow = mainWindow;

            this.shell.AttemptingDeactivation += ShellDeactivating;
        }
        public S3StateManager(IAwsFactoryWrapper awsFactoryWrapper, IStateManager fallbackStateManager)
        {
            if (awsFactoryWrapper == null) throw new ArgumentNullException("awsFactoryWrapper");
            if (fallbackStateManager == null) throw new ArgumentNullException("fallbackStateManager");

            _awsFactoryWrapper = awsFactoryWrapper;
            _fallbackStateManager = fallbackStateManager;
            BucketRegion = S3Region.US;
        }
Exemple #14
0
 /**
  * Constructs a new <code>GameState</code> being managed by
  * the specified <code>StateManager</code> class.
  *
  * @param manager The state manager to manage this state.
  * @param game XNA's game class to get accesses to
  *      resource managers and devices.
  */
 public GameState(IStateManager manager, DroughtGame game)
 {
     this.game = game;
     stateManager = manager;
     this.content = new ContentManager(game.Services);
     this.content.RootDirectory = "Content";
     this.graphics = game.getGraphics();
     this.spriteBatch = game.getSpriteBatch();
 }
Exemple #15
0
 public MenuState(IStateManager manager, DroughtGame game, int width, int height)
     : base(manager, game)
 {
     screenWidth = width;
     screenHeight = height;
     loadContent();
     initialise();
     networkManager = game.getNetworkManager();
 }
        public IStateManager GetObject()
        {
            if (this._Obj == null)
            {
				this._Obj = (IStateManager)TypeCreator.CreateInstance(this._StateType);
                this._Obj.LoadViewState(this._State);
            }
            return this._Obj;
        }
        protected QueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IKeyValueFactorySource keyValueFactorySource)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(keyValueFactorySource, nameof(keyValueFactorySource));

            _stateManager = stateManager;
            _keyValueFactorySource = keyValueFactorySource;
        }
Exemple #18
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        public GameState(Game game)
            : base(game)
        {
            tag = this;

            childComponents = new List<GameComponent>();
            content = Game.Content;

            manager = (IStateManager)Game.Services.GetService(typeof(IStateManager));
        }
        public ViewSateItemInternal(IStateManager obj)
        {
            this._Obj = obj;
            this._StateType = obj.GetType();

            //Style style = obj as Style;
            //if (style != null)
            //    style.SetDirty();

            this._State = obj.SaveViewState();
        }
 public ChangeTrackerFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityEntryGraphIterator graphIterator,
     [NotNull] ICurrentDbContext currentContext)
 {
     _stateManager = stateManager;
     _changeDetector = changeDetector;
     _graphIterator = graphIterator;
     _context = currentContext.Context;
 }
 public QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrCollectionAccessorSource clrCollectionAccessorSource,
     [NotNull] IClrAccessorSource<IClrPropertySetter> clrPropertySetterSource)
 {
     _stateManager = stateManager;
     _entityKeyFactorySource = entityKeyFactorySource;
     _clrCollectionAccessorSource = clrCollectionAccessorSource;
     _clrPropertySetterSource = clrPropertySetterSource;
 }
        private InternalEntityEntry NewInternalEntityEntry(IStateManager stateManager, IEntityType entityType, object entity, IValueReader valueReader)
        {
            if (!entityType.HasClrType())
            {
                return new InternalShadowEntityEntry(stateManager, entityType, _metadataServices, valueReader);
            }

            return entityType.ShadowPropertyCount() > 0
                ? (InternalEntityEntry)new InternalMixedEntityEntry(stateManager, entityType, _metadataServices, entity, valueReader)
                : new InternalClrEntityEntry(stateManager, entityType, _metadataServices, entity);
        }
        public SecondViewModel()
        {
            StateManager = new BaseStateManager<SecondStates, SecondStateTransitions>();
            StateManager.DefineAllStates();
            


            StateManager2 = new BaseStateManager<SecondStates2, SecondStateTransitions>();
            StateManager2.DefineAllStates();
            
        }
		public NewContractViewModel(INavigationService navigationService, IUsersRepository repository, IOpenGraphRepository openGraphRepository,
			IUserRepository userRepository, IStateManager stateManager, IMessageRepository messageRepository)
			: base(navigationService, stateManager)
		{
			_repository = repository;
			_openGraphRepository = openGraphRepository;
			_userRepository = userRepository;
			_messageRepository = messageRepository;
			_selectedAssignees = new List<AutoCompleteUser>();

			Assignees = new BindableCollection<AutoCompleteUser>();
		}
        public StreamListener(IResourceFacade resource, IAdapterPlugin platformConnector, IEventState eventState, IStateManager stateManager,ISettings settings)
        {
            if (resource == null)
                throw new ArgumentException("Resource information cannot be null");

            if (resource.Content == null)
                throw new Exception("Resource does not contain any content");


            _logger.DebugFormat("Instantiating listener for {0} with sequence={1}", resource, resource.Content.Sequence);

            _lockTimeout = settings.ProcessingLockTimeOutInSecs;
            _resource = resource;
            _platformConnector = platformConnector;
            _eventState = eventState;
            _stateManager = stateManager;
            _settings = settings;

            _currentSequence = resource.Content.Sequence;
            _lastSequenceProcessedInSnapshot = -1;
            
            _hasRecoveredFromError = true;
            _isFirstSnapshotProcessed = false;
            _isProcessingFirstSnapshot = false;
            _performingDelayedStop = false;

            _marketsRuleManager = stateManager.CreateNewMarketRuleManager(resource.Id);

            FixtureId = resource.Id;
            Sport = resource.Sport;
            SequenceOnStreamingAvailable = _currentSequence;

            IsStreaming = false;
            IsConnecting = false;
            IsDisposing = false;
            IsErrored = false;
            IsIgnored = false;
            IsStopping = false;

            var fixtureState = _eventState.GetFixtureState(resource.Id);

            IsFixtureEnded = fixtureState != null ? fixtureState.MatchStatus == MatchStatus.MatchOver : _resource.IsMatchOver;
            IsFixtureSetup = (_resource.MatchStatus == MatchStatus.Setup || _resource.MatchStatus == MatchStatus.Ready);
            IsFixtureDeleted = false;
            IsInPlay = fixtureState != null ? fixtureState.MatchStatus == MatchStatus.InRunning : _resource.MatchStatus == MatchStatus.InRunning;
            _currentEpoch = fixtureState != null ? fixtureState.Epoch : -1;
            
            _Stats = StatsManager.Instance[string.Concat("adapter.core.sport.", resource.Sport)].GetHandle();

            SetupListener();
            _logger.DebugFormat("Listener instantiated for {0}", resource);

        }
        public MyContractsViewModel(INavigationService navigationService, IStateManager stateManager)
            : base(navigationService, stateManager)
        {
            this.MyContracts = new BindableCollection<Contract>();

            /* In a real app you would populate your list of contracts from a real data source */

            this.MyContracts.AddRange(new Contract[] {
                new Contract { Name = "Mouse Bait Supplies", Assignees = "Eric, Julie, Paul" },
                new Contract { Name = "How To Best Annoy Your Human App", Assignees = "Jack, Kate, Hugo, Sawyer" },
                new Contract { Name = "How To Nap e-book", Assignees = "Joffrey, Cersei, Jaime, Tyrion" }});
        }
Exemple #27
0
 protected TiledGame()
 {
     loader = new ModuleLoader();
     loader.Load();
     this.stateManager = loader.GetStateManager();
     this.spriteDrawer = loader.GetDrawer();
     this.spriteFontDawer = loader.GetFontDrawer();
     this.inputManager = loader.GetInputManager();
     this.virtualScreen = loader.GetVirtualScreen();
     this.camera = loader.GetCamera();
     this.contentLoader = loader.GetContentLoader();
 }
Exemple #28
0
 protected State(IDictionary<Type, object> managers)
 {
     StateManager = (IStateManager) managers[typeof (IStateManager)];
     NetworkManager = (INetworkManager) managers[typeof (INetworkManager)];
     ResourceManager = (IResourceManager) managers[typeof (IResourceManager)];
     UserInterfaceManager = (IUserInterfaceManager) managers[typeof (IUserInterfaceManager)];
     MapManager = (IMapManager) managers[typeof (IMapManager)];
     PlayerManager = (IPlayerManager) managers[typeof (IPlayerManager)];
     ConfigurationManager = (IConfigurationManager) managers[typeof (IConfigurationManager)];
     PlacementManager = (IPlacementManager) managers[typeof (IPlacementManager)];
     KeyBindingManager = (IKeyBindingManager) managers[typeof (IKeyBindingManager)];
 }
        private InternalEntityEntry NewInternalEntityEntry(IStateManager stateManager, IEntityType entityType, object entity)
        {
            if (!entityType.HasClrType())
            {
                return new InternalShadowEntityEntry(stateManager, entityType, _metadataServices);
            }

            Debug.Assert(entity != null);

            return entityType.ShadowPropertyCount() > 0
                ? (InternalEntityEntry)new InternalMixedEntityEntry(stateManager, entityType, _metadataServices, entity)
                : new InternalClrEntityEntry(stateManager, entityType, _metadataServices, entity);
        }
Exemple #30
0
 public Trick(
     RoundPlayerInfo firstToPlay,
     RoundPlayerInfo secondToPlay,
     IStateManager stateManager,
     IDeck deck,
     IGameRules gameRules)
 {
     this.firstToPlay = firstToPlay;
     this.secondToPlay = secondToPlay;
     this.stateManager = stateManager;
     this.deck = deck;
     this.gameRules = gameRules;
 }
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public static IReadOnlyList <InternalEntityEntry> ToList(
     [NotNull] this IStateManager stateManager)
 => stateManager.ToListForState(added: true, modified: true, deleted: true, unchanged: true);
Exemple #32
0
 public IFlowReportManager GetFlowReportManager(IStateManager stateManager)
 {
     return(new FlowReportManager(stateManager, new FlowConsoleLogger()));
 }
Exemple #33
0
        public ScriptPlayer(ScriptPlayerConfiguration config, ResourceProviderConfiguration providerConfig,
                            IScriptManager scriptManager, IInputManager inputManager, IStateManager stateManager)
        {
            Configuration       = config;
            this.providerConfig = providerConfig;
            this.scriptManager  = scriptManager;
            this.inputManager   = inputManager;
            this.stateManager   = stateManager;

            GosubReturnSpots     = new Stack <PlaybackSpot>();
            playedScriptRegister = new PlayedScriptRegister();
            commandExecutionCTS  = new CancellationTokenSource();
            synchronizationCTS   = new CancellationTokenSource();
        }
Exemple #34
0
 public virtual InternalEntityEntry Create(IStateManager stateManager, IEntityType entityType, object entity)
 => NewInternalEntityEntry(stateManager, entityType, entity);
Exemple #35
0
 public virtual InternalEntityEntry Create(IStateManager stateManager, IEntityType entityType, object entity, ValueBuffer valueBuffer)
 => NewInternalEntityEntry(stateManager, entityType, entity, valueBuffer);
Exemple #36
0
        internal static bool CanRetryProcess(this IReadWritableProcessState state,
                                             IProcessExecutionContext executionContext,
                                             ILogger processLogger, IProcessRepository registeredProcesses,
                                             IBatchEngineSubscribers batchEngineSubscribers, IStateManager stateManager, IFrameworkLogger fLogger,
                                             out bool stop, out string stopMessage)
        {
            stop        = false;
            stopMessage = string.Empty;

            var process = registeredProcesses.GetRegisteredProcesses().FirstOrDefault(p => p.ProcessKey == executionContext.Configuration.ProcessKey);

            ProcessRetryContext context = new ProcessRetryContext(state.Id, state.ProcessId, processLogger, executionContext);

            process?.InvokeProcessRetry(context);

            if (context.StopFlag)
            {
                processLogger.Warn("Retry stopped by process class {processType}", process?.GetType());

                //state.MarkProcessStatus(CompletionStatus.Finished, ResultStatus.Error,
                //    "Retry stopped by process class", stateManager, registeredProcesses, executionContext, batchEngineSubscribers, fLogger);
                stopMessage = "Retry stopped by process class";
                stop        = true;
                return(false);
            }

            foreach (var processSubscriber in batchEngineSubscribers.GetProcessSubscribers().Where(s => s.ProcessKey == context.Configuration.ProcessKey))
            {
                Robustness.Instance.SafeCall(() => processSubscriber.OnProcessRetry(context),
                                             executionContext.Logger);
                if (context.StopFlag)
                {
                    processLogger.Warn($"Retry stopped by extension {processSubscriber.GetType()}");
                    stop        = true;
                    stopMessage = $"Retry stopped by extension {processSubscriber.GetType()}";

                    //state.MarkProcessStatus(CompletionStatus.Finished, ResultStatus.Error,
                    //    $"Retry stopped by extension {processSubscriber.GetType()}", stateManager, registeredProcesses, executionContext, batchEngineSubscribers, fLogger);

                    //_eventAggregator.Publish(this, Constants.EventProcessStop,
                    //    processId.ToString());

                    return(false);
                }
            }

            return(true);
        }
Exemple #37
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public UpdateAdapter([NotNull] IStateManager stateManager)
 {
     _stateManager   = stateManager;
     _changeDetector = _stateManager.Context.GetDependencies().ChangeDetector;
 }