protected override void ConfigureView()
        {
            //Setp local stores
            this.activeQuads = new List<ActiveQuad>();
            this.SelectQuad.options = new List<Dropdown.OptionData>();
            this.userSelectedQuad = null;
            this.waitingSelectedQuadConfirmation = false;
            this.SelectQuad.interactable = false;

            //Setup notification text
            this.Notifications.text = string.Empty;
            this.Notifications.gameObject.SetActive(false);
            this.SelectionBoxHeader.text = "Available Quads";

            //Setup the views buttons
            this.CancelView.onClick.RemoveAllListeners();
            this.CancelView.onClick.AddListener(this.Disable);
            this.CancelView.interactable = true;
            this.OkView.onClick.RemoveAllListeners();
            this.OkView.onClick.AddListener(this.Complete);
            this.OkView.interactable = false;

            this.ConfirmSelection.onClick.RemoveAllListeners();
            this.ConfirmSelection.onClick.AddListener(this.ConfirmQuadSelection);
            this.ConfirmSelection.interactable = false;

            //Setup dropdown selection
            this.SelectQuad.onValueChanged.RemoveAllListeners();
            this.SelectQuad.onValueChanged.AddListener(this.ProcessSelection);
        }
        protected override void ConfigureView()
        {
            //Setp local stores
            this.activeQuads        = new List <ActiveQuad>();
            this.SelectQuad.options = new List <Dropdown.OptionData>();
            this.userSelectedQuad   = null;
            this.waitingSelectedQuadConfirmation = false;
            this.SelectQuad.interactable         = false;

            //Setup notification text
            this.Notifications.text = string.Empty;
            this.Notifications.gameObject.SetActive(false);
            this.SelectionBoxHeader.text = "Available Quads";

            //Setup the views buttons
            this.CancelView.onClick.RemoveAllListeners();
            this.CancelView.onClick.AddListener(this.Disable);
            this.CancelView.interactable = true;
            this.OkView.onClick.RemoveAllListeners();
            this.OkView.onClick.AddListener(this.Complete);
            this.OkView.interactable = false;

            this.ConfirmSelection.onClick.RemoveAllListeners();
            this.ConfirmSelection.onClick.AddListener(this.ConfirmQuadSelection);
            this.ConfirmSelection.interactable = false;

            //Setup dropdown selection
            this.SelectQuad.onValueChanged.RemoveAllListeners();
            this.SelectQuad.onValueChanged.AddListener(this.ProcessSelection);
        }
        private void ProcessSelection(int selectedQuad)
        {
            //Map the selected quad.
            this.userSelectedQuad = this.activeQuads[selectedQuad];

            //Enable confirm Selection button
            this.ConfirmSelection.interactable = true;
        }
Beispiel #4
0
        public RequestQuadConfirmation ConfirmQuadSelection(IView registerdView, ActiveQuad selectedQuad)
        {
            RequestQuadConfirmation requestResult = RequestQuadConfirmation.RequestSent;

            if (this.ViewHandlerMappers.ContainsKey(registerdView))
            {
                this.Send <ActiveQuad>(selectedQuad);

                if (!this.waitingSelectionConfirmation.ContainsKey(selectedQuad.QuadId))
                {
                    this.waitingSelectionConfirmation.Add(selectedQuad.QuadId, registerdView);
                }
                else
                {
                    requestResult = RequestQuadConfirmation.QuadAlreadyPending;
                }
            }
            else
            {
                throw new ViewNotRegisteredException("Unable to send Quad confirmation request view " + registerdView.ToString() + " not registered.");
            }

            return(requestResult);
        }
        public RequestQuadConfirmation ConfirmQuadSelection(IView registerdView, ActiveQuad selectedQuad)
        {
            RequestQuadConfirmation requestResult = RequestQuadConfirmation.RequestSent;

            if (this.ViewHandlerMappers.ContainsKey(registerdView))
            {
                this.Send<ActiveQuad>(selectedQuad);

                if (!this.waitingSelectionConfirmation.ContainsKey(selectedQuad.QuadId))
                {
                    this.waitingSelectionConfirmation.Add(selectedQuad.QuadId, registerdView);
                }
                else
                {
                    requestResult = RequestQuadConfirmation.QuadAlreadyPending;
                }
            }
            else
            {
                throw new ViewNotRegisteredException("Unable to send Quad confirmation request view " + registerdView.ToString() +" not registered.");
            }

            return requestResult;
        }
        private void ProcessSelection(int selectedQuad)
        {
            //Map the selected quad.
            this.userSelectedQuad = this.activeQuads[selectedQuad];

            //Enable confirm Selection button
            this.ConfirmSelection.interactable = true;
        }
 public void UpdateQuad(ActiveQuad activeQuad)
 {
     var quad = activeQuad;
 }
 public QuadSelectionConfirmed(ActiveQuad theQuad, bool confirmed)
 {
     this.TheQuad   = theQuad;
     this.Confirmed = confirmed;
 }