示例#1
0
        public UITitleTopPage(CanvasContainer canvasContainer) : base(canvasContainer)
        {
            _backgroundPresenter =
                CreatePresenter <UITitleBackgroundPresenter, UITitleBackgroundWindow>(canvasContainer.Canvases[0],
                                                                                      UITitlePrefabPathDef.UITitleBackgroundWindow);

            _staffCreditPresenter =
                CreatePresenter <UITitleStaffCreditPresenter, UITitleStaffCreditDialog>(canvasContainer.Canvases[1],
                                                                                        UITitlePrefabPathDef.UITitleStaffCreditDialog);

            _backgroundPresenter.SetActiveView(true);

            // イベントの購読
            _backgroundPresenter
            .OnTapCreditButton
            .Subscribe(async _ => await _staffCreditPresenter.ShowAsync())
            .AddTo(_backgroundPresenter.TargetView);

            _backgroundPresenter
            .OnPointerDown
            .Subscribe(async _ => await SceneManager.LoadSceneAsync(SceneDef.HomeScene))
            .AddTo(_backgroundPresenter.TargetView);

            _staffCreditPresenter
            .ReturnButtonAsObservable
            .Subscribe(async _ => await _staffCreditPresenter.HideAsync())
            .AddTo(_staffCreditPresenter.TargetView);
        }
示例#2
0
 public TicTacToePresenter(TicTacToeForm ticTacToeForm)
 {
     _gameCanvases    = EnumUtil.GetListOfEnumElement <CanvasType>("Matrix");
     _ticTacToeForm   = ticTacToeForm;
     _canvasContainer = new CanvasContainer();
     _network         = new ActivationNetwork(new SigmoidFunction(2), 100, 14, 2);
     new BackPropagationLearning(_network);
     _pen                          = new Pen(Color.Black, 5);
     _crossDesignator              = new CrossDesignator();
     _network                      = (ActivationNetwork)Network.Load("Net.bin");
     _gameUtil                     = new GameUtil();
     _computerPlayer               = new ComputerPlayer(_gameUtil, _gameCanvases);
     _board                        = new GameBoard(_gameCanvases);
     _game                         = new Game(_gameUtil, _board, _computerPlayer);
     _ticTacToeForm.DrawAction    += Draw;
     _ticTacToeForm.LearnAction   += ExecuteLearnAction;
     _ticTacToeForm.CrossAction   += ExecuteCrossAction;
     _ticTacToeForm.CircleAction  += ExecuteCircleAction;
     _ticTacToeForm.ClearAction   += ExecuteClearAction;
     _ticTacToeForm.CopyAction    += ExecuteCopyAction;
     _ticTacToeForm.TestAction    += ExecuteTestAction;
     _ticTacToeForm.NewGameAction += ExecuteNewGameAction;
     _ticTacToeForm.PlayAction    += ExecutePlayAction;
     _ticTacToeForm.BackAction    += ExecuteBackAction;
     _lastModifiedCanvas           = CanvasType.Matrix11;
     _paintFactory                 = new PaintFactory(_pen, _crossDesignator);
 }
示例#3
0
 public ViewFactory(CanvasContainer canvasContainer, ViewsContainer viewsContainer,
                    ICameraManager cameraManager, ILoggerManager loggerManager)
 {
     _cameraManager   = cameraManager;
     _canvasContainer = canvasContainer;
     _viewsContainer  = viewsContainer;
     _logger          = loggerManager.GetLogger();
 }
示例#4
0
        public void GetEnumerator_WithChildren_EnumeratorMatchesChildren()
        {
            CanvasContainer container = new CanvasContainer();
            CanvasObject    co        = new ButtonObject();

            container.Add(co);

            Assert.AreEqual(1, container.Count());
        }
        public UIInGameBattlePage(CanvasContainer canvasContainer) : base(canvasContainer)
        {
            _inGameBattlePresenter =
                CreatePresenter <UIInGameBattlePresenter, UIInGameBattleWindow>(canvasContainer.Canvases[0],
                                                                                UIInGamePrefabPathDef.UIInGameBattleWindow);

            _inGameBattlePresenter.SetActiveView(true);

            _inGameBattlePresenter.InitializeUIInGameBattleWindow(canvasContainer.Canvases[0].GetCamera());
        }
示例#6
0
        public void Draw_WithChildren_DrawForwarded()
        {
            CanvasContainer container = new CanvasContainer();
            DummyObject     co        = new DummyObject();

            container.Add(co);

            container.Draw(null, null);

            Assert.AreEqual(1, co.drawCount);
        }
示例#7
0
        public UIHomeTopPage(CanvasContainer canvasContainer) : base(canvasContainer)
        {
            _backgroundPresenter =
                CreatePresenter <UIHomeBackgroundPresenter, UIHomeBackgroundWindow>(canvasContainer.Canvases[0],
                                                                                    UIHomePrefabPathDef.UIHomeBackgroundWindow);

            _backgroundPresenter.SetActiveView(true);

            _backgroundPresenter
            .OnTapMatchingButton
            .Subscribe(_ => ShowPage <UIHomeMatchingPage>(canvasContainer))
            .AddTo(_backgroundPresenter.TargetView);
        }
        public UIHomeMatchingPage(CanvasContainer canvasContainer) : base(canvasContainer)
        {
            _matchingTopPresenter =
                CreatePresenter <UIHomeMatchingTopPresenter, UIHomeMatchingTopWindow>(canvasContainer.Canvases[0],
                                                                                      UIHomePrefabPathDef.UIHomeMatchingTopWindow);

            _matchingTopPresenter.ShowWindowCommonAsync().Forget();

            _matchingTopPresenter
            .OnTapReturnButton
            .Subscribe(_ => ShowPage <UIHomeTopPage>(canvasContainer))
            .AddTo(_matchingTopPresenter.TargetView);
        }
示例#9
0
        public void Add_Child_ChildAddedCollectionChangedTriggered()
        {
            int             collectionChangedCount = 0;
            CanvasContainer container = new CanvasContainer();

            container.CollectionChanged += (sender, e) => collectionChangedCount++;
            CanvasObject co = new ButtonObject();

            container.Add(co);

            Assert.AreEqual(1, collectionChangedCount);
            Assert.AreEqual(1, container.Count);
        }
示例#10
0
        public void Clear_Existing_AllChildRemoved()
        {
            int             collectionChangedCount = 0;
            CanvasContainer container = new CanvasContainer();
            CanvasObject    co        = new ButtonObject();

            container.Add(co);
            container.CollectionChanged += (sender, e) => collectionChangedCount++;

            container.Clear();

            Assert.AreEqual(1, collectionChangedCount);
            Assert.AreEqual(0, container.Count);
        }
示例#11
0
        public void Add_ChildRedraw_RedrawForwarded()
        {
            int             redrawCount = 0;
            CanvasContainer container   = new CanvasContainer();

            container.RedrawEvent += (c, area) => redrawCount++;
            CanvasObject co = new ButtonObject();

            container.Add(co);

            co.ReDraw();

            Assert.AreEqual(1, redrawCount);
        }
示例#12
0
 private void Viewmodel_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(ViewModel.Card))
     {
         if (ViewModel.Card != null)
         {
             GoToState(CardDataName);
             CanvasContainer.AbortAnimation(ThrobAnimationName);
         }
         else
         {
             GoToState(NoCardDataName);
             CanvasContainer.Animate(ThrobAnimationName, _promptThrobAnimation, rate: 16, length: 3000, repeat: () => true);
         }
     }
 }
示例#13
0
        private void BuildCanvas(Transform homeMainTransform, ICamera homeUICamera)
        {
            // CanvasのPrefabのパスのリスト
            var canvasPaths = new List <string>()
            {
                UICommonDef.App0CanvasPrefabPath,
                UICommonDef.App1CanvasPrefabPath
            };

            var canvasPathParams = new CanvasPathParams(UICommonDef.CanvasRootName, canvasPaths);

            var canvasRoot = EmptyObjectFactory.Create(canvasPathParams.CanvasRootName, homeMainTransform);

            _canvasContainer = CanvasBuilder.BuildCanvases(homeUICamera, canvasPathParams,
                                                           UICommonDef.UITouchBlockWindow, canvasRoot.transform);
        }
示例#14
0
    void CreateCanvas()
    {
        GameObject cnvs = Instantiate(canvasPrefab, transform.position, Quaternion.identity) as GameObject;

        cnvs.name = "CanvasMain";
        cnvs.transform.SetParent(transform);
        cnvs.transform.position = Vector2.zero;

        canvasContainer          = cnvs.GetComponent <CanvasContainer>();
        dialogAnimator           = canvasContainer.dialogAnimator;
        dialogText               = canvasContainer.dialogText;
        actionFeedbackController = canvasContainer.actionFeedback;
        gui.healthbar            = canvasContainer.healthbar;
        gui.saveAnimator         = canvasContainer.saveAnimator;
        gui.reloadController     = canvasContainer.reloadController;
        gui.fadeAnimator         = canvasContainer.fadeAnimator;
        gui.fadeImg              = canvasContainer.fadeImg;
        inventory = canvasContainer.inventory;

        canvasContainer.SetRenderCamera();
    }
示例#15
0
 void Initialize()
 {
     container = transform.parent.gameObject.GetComponent <CanvasContainer>();
     gridSize  = CanvasContainer.size;
 }
示例#16
0
        public static TPage Create(CanvasContainer canvasContainer)
        {
            _delegateCache ??= CreateInstanceDelegate();

            return(_delegateCache(canvasContainer));
        }
示例#17
0
        protected void ShowPage <TPage>(CanvasContainer canvasContainer) where TPage : IPage
        {
            PageFactory <TPage> .Create(canvasContainer);

            Dispose();
        }
示例#18
0
 protected PageBase(CanvasContainer canvasContainer)
 {
 }
示例#19
0
 void Start()
 {
     canvasContainer = transform.GetComponentInParent <CanvasContainer>();
 }