Exemple #1
0
        public FormsNavigationHelper(Application app)
        {
            _app        = app;
            ViewCreator = new DefaultViewCreator();

            Abstraction.NavigationHelper.Current = this;
        }
 public CachedDanmakuViewPool(long keepAliveTime, int maxSize, IViewCreator <DanmakuView> creator)
 {
     KeepAliveTime = keepAliveTime;
     MaxSize       = maxSize;
     Creator       = creator;
     InUseSize     = 0;
     ScheduleCheckUnusedViews();
 }
Exemple #3
0
        public DeathHandler(IUiFacade uiFacade, IViewCreator viewCreator, IGameConfig gameConfig, IPositionEffectPresenter positionEffectPresenter, IOsnowaContextManager contextManager)
        {
            _uiFacade    = uiFacade;
            _viewCreator = viewCreator;
            _gameConfig  = gameConfig;

            _positionEffectPresenter = positionEffectPresenter;
            _contextManager          = contextManager;
        }
Exemple #4
0
        public void Init()
        {
            viewCreator = GetComponent <IViewCreator>();
            if (viewCreator == null)
            {
                throw new Exception("ViewStack doens't have an IViewCreator attached to it.");
            }

            isInitialized = true;
        }
Exemple #5
0
        public ShellViewModel(IViewCreator viewCreator, IEventAggregator eventAggregator)
        {
            _viewCreator     = viewCreator;
            _eventAggregator = eventAggregator;

            _eventAggregator.GetEvent <MessageViewOpenedEvent>().Subscribe(OnMessageViewOpened);
            _eventAggregator.GetEvent <MessageViewClosedEvent>().Subscribe(OnMessageViewClosed);

            _mainView = _viewCreator.GetInstance("BDEventsView");
            ChildView = _mainView;
        }
Exemple #6
0
        public BDEventsViewModel(ISangueaseAPI api, IViewCreator viewCreator, IEventAggregator eventAggregator)
        {
            _api             = api;
            _viewCreator     = viewCreator;
            _eventAggregator = eventAggregator;

            //subscribe to events
            _eventAggregator.GetEvent <AddBDEventClosedEvent>().Subscribe(OnAddBDEventClosed);
            _eventAggregator.GetEvent <EditBDEventClosedEvent>().Subscribe(OnEditBDEventClosed);

            _ = UpdateBDEventsAsync();
        }
Exemple #7
0
        public EntryEditorBaseView CreateView(Type entryType)
        {
            IViewCreator creator = null;

            if (_creators.TryGetValue(entryType, out creator))
            {
                return(creator.Create());
            }
            else
            {
                throw new InvalidOperationException($"{entryType}' type not registered.");
            }
        }
Exemple #8
0
        public FormsNavigationHelper()
        {
            if (Assembly.GetExecutingAssembly().FullName.Contains("TinyMvvm"))
            {
                ViewCreator = new TinyMvvmViewCreator();
            }
            else
            {
                ViewCreator = new DefaultViewCreator();
            }



            Abstraction.NavigationHelper.Current = this;
        }
Exemple #9
0
        public WorldClock(ISceneContext sceneContext, IGameConfig gameConfig,
                          IUiFacade uiFacadeUiFacade, IEntityDetector entityDetector, ITileMatrixUpdater tileMatrixUpdater,
                          IRandomNumberGenerator rng, IViewCreator viewCreator,
                          IOsnowaContextManager contextManager)
        {
            _sceneContext = sceneContext;

            _gameConfig        = gameConfig;
            _uiFacade          = uiFacadeUiFacade;
            _entityDetector    = entityDetector;
            _tileMatrixUpdater = tileMatrixUpdater;
            _rng            = rng;
            _viewCreator    = viewCreator;
            _contextManager = contextManager;
            _gameContext    = Contexts.sharedInstance.game;

            double minutesInDay = new TimeSpan(1, 0, 0, 0).TotalMinutes;

            _minutesInTurn = minutesInDay / _gameConfig.TurnsInDay;
        }
Exemple #10
0
 public ActionFactory(IGrid grid, IActionEffectFactory actionEffectFactory, IUnityGridInfoProvider unityGridInfoProvider, IPositionEffectPresenter positionEffectPresenter, IRandomNumberGenerator randomNumberGenerator, IDeathHandler deathHandler, ISceneContext sceneContext, IGameConfig gameConfig, IViewCreator viewCreator, ITileMatrixUpdater tileMatrixUpdater, IFirstPlaceInAreaFinder firstPlaceInAreaFinder, IBroadcastStimulusSender stimulusBroadcaster, IEntityDetector entityDetector, LoadViewSystem loadViewSystem, IUiFacade uiFacade, IOsnowaContextManager contextManager, IEntityViewBehaviourInitializer entityViewBehaviourInitializer, IAggressionTriggerer aggressionTriggerer, IEntityGenerator entityGenerator, ReactiveFeature reactiveFeature)
 {
     _grid = grid;
     _unityGridInfoProvider   = unityGridInfoProvider;
     _positionEffectPresenter = positionEffectPresenter;
     _randomNumberGenerator   = randomNumberGenerator;
     _deathHandler            = deathHandler;
     _actionEffectFactory     = actionEffectFactory;
     _sceneContext            = sceneContext;
     _gameConfig             = gameConfig;
     _viewCreator            = viewCreator;
     _tileMatrixUpdater      = tileMatrixUpdater;
     _firstPlaceInAreaFinder = firstPlaceInAreaFinder;
     _stimulusBroadcaster    = stimulusBroadcaster;
     _entityDetector         = entityDetector;
     _loadViewSystem         = loadViewSystem;
     _uiFacade       = uiFacade;
     _contextManager = contextManager;
     _entityViewBehaviourInitializer = entityViewBehaviourInitializer;
     _aggressionTriggerer            = aggressionTriggerer;
     _entityGenerator = entityGenerator;
     _reactiveFeature = reactiveFeature;
 }
    /// <summary>
    ///     Inflates a view.
    /// </summary>
    /// <param name="viewCreator">The <see cref="IViewCreator" /> in charge of creating the view.</param>
    /// <param name="context">The context that the view will be inflated in</param>
    /// <param name="attrs">The attributes to apply to the view</param>
    /// <param name="name">The fully qualified name of the view being inflated.</param>
    /// <param name="parent">The view's parent, if any.</param>
    public virtual View Inflate(IViewCreator viewCreator, Context context, IAttributeSet attrs, string name, View parent)
    {
        InflateRequested?.Invoke(this, new InflateRequestedEventArgs(context, attrs, name, parent));

        View view = null;

        if (InterceptingService.Delegate == null || InterceptingService.Delegate.OnInflateRequested(context, attrs, name, parent))
        {
            view = viewCreator.OnCreateView(parent, name, context, attrs);

            if (view != null)
            {
                // Try to assign the correct view name for the benefit of the below events.
                name = view.Class?.Name ?? name;

                ViewInflated?.Invoke(this, new ViewInflatedEventArgs(context, attrs, name, view));

                InterceptingService.Delegate?.OnViewInflated(context, attrs, name, view);
            }
        }

        return(view);
    }
Exemple #12
0
        public void Init(IPathfinder pathfinder, ITilemapInitializer tilemapInitializer,
                         IEntityViewBehaviourInitializer entityViewBehaviourInitializer, IGameConfig gameConfig, IViewCreator viewCreator,
                         IPositionFlagsResolver positionFlagsResolver, IStimulusReceiver stimulusReceiver,
                         ISavedComponents savedComponents, GameContext context, PerInitiativeFeature perInitiativeFeature, RealTimeFeature realTimeFeature,
                         IOsnowaContextManager contextManager, IGrid grid)
        {
            _realTimeFeature      = realTimeFeature;
            _perInitiativeFeature = perInitiativeFeature;

            _tilemapInitializer    = tilemapInitializer;
            _pathfinder            = pathfinder;
            _gameConfig            = gameConfig;
            _positionFlagsResolver = positionFlagsResolver;
            _stimulusReceiver      = stimulusReceiver;
            _savedComponents       = savedComponents;
            _context        = context;
            _contextManager = contextManager;
            _grid           = grid;
        }
Exemple #13
0
 public LoadViewSystem(IViewCreator viewCreator, IContext <GameEntity> context) : base(context)
 {
     _viewCreator = viewCreator;
 }