Пример #1
0
        public NewLevelBox(Location location, int startNumRows, int startNumColumns) : base(edgeThickness, null)
        {
            Dimensions = new WrapperDimensions(edgeThickness * 2 + padding, edgeThickness * 2 + padding, true, true);

            Location = CenteredLocation.All;

            edgeColor  = Utility.DrawingColorToXNAColor(DefaultUIValues.Default.BoxEdgeColor);
            innerColor = Utility.DrawingColorToXNAColor(DefaultUIValues.Default.BoxInnerColor);

            innerComponentsContainer = new UIComponent(CenteredLocation.All, WrapperDimensions.All);

            columnsEdit = new NumberInputBox(SimpleLocation.Zero, new CombinationDimensions(InheritDimensions.All, new MeasuredDimensions()), Strings.columns_edit_text, startNumColumns, 1, spritefont: DefaultUIValues.Default.DefaultEditorControlSpriteFont);
            rowsEdit    = new NumberInputBox(new RelativeToLocation(columnsEdit, 0, 10, true, false), new CombinationDimensions(InheritDimensions.All, new MeasuredDimensions(rowsEdit)), Strings.rows_edit_text, startNumRows, 1, spritefont: DefaultUIValues.Default.DefaultEditorControlSpriteFont);

            UIComponent centerSpanner = new UIComponent(new CombinationLocation(new CenteredLocation(horizontalCenter: true), new RelativeToLocation(rowsEdit, 0, 50, true, false)), WrapperDimensions.All);

            Button okButton = new SpriteSheetButton(SimpleLocation.Zero, null, Strings.begin, onClick: (UIComponent component) =>
            {
                Succes?.Invoke(this);
            });
            Button cancelButton = new SpriteSheetButton(new RelativeToLocation(okButton, 40, 0, false), null, Strings.cancel, onClick: (UIComponent component) =>
            {
                Visible = false;
            });

            centerSpanner.AddConstantComponent(okButton);
            centerSpanner.AddConstantComponent(cancelButton);

            innerComponentsContainer.AddConstantComponent(columnsEdit);
            innerComponentsContainer.AddConstantComponent(rowsEdit);
            innerComponentsContainer.AddConstantComponent(centerSpanner);

            AddConstantComponent(innerComponentsContainer);
        }
        public IResponseBase Response()
        {
            Succes response = new Succes();

            response.StatusCode = StatusCode.OK;
            response.SetContent(new JavaScriptSerializer().Serialize(playerInformation));
            return(response);
        }
        public IResponseBase Response()
        {
            Succes response = new Succes();

            response.StatusCode = StatusCode.OK;
            response.SetContent("hk");
            return(response);
        }
Пример #4
0
    public void Reset()
    {
        m_playerSucces = new Dictionary <string, Succes>();

        foreach (Succes s in m_playerSuccesInit)
        {
            Succes newSucces = new Succes(s.Key, s.Value);
            m_playerSucces.Add(newSucces.Key, newSucces);
        }
    }
Пример #5
0
        public void Test_Classes()
        {
            Beer        beerObj        = new Beer();
            Bar         barObj         = new Bar();
            Check       checkObj       = new Check();
            RestService restServiceObj = new RestService();
            Succes      succesObj      = new Succes();
            User        userObj        = new User();


            Assert.IsNotNull(beerObj);
            Assert.IsNotNull(barObj);
            Assert.IsNotNull(checkObj);
            Assert.IsNotNull(restServiceObj);
            Assert.IsNotNull(succesObj);
            Assert.IsNotNull(userObj);
        }
Пример #6
0
 public void OnSuccess(Java.Lang.Object result)
 {
     Succes?.Invoke(result, new EventArgs());
 }
Пример #7
0
    // Update is called once per frame
    void Update()
    {
        if (swiping.SwipeLeft || swiping.SwipeRight)
        {
            if (panel.page == 1)
            {
                if (panel.lockSucces.Count > 0)
                {
                    lastSucces = panel.lockSucces[panel.lockSucces.Count - 1];
                }
            }
            if (panel.page == 2)
            {
                if (panel.unlockSucces.Count > 0)
                {
                    lastSucces = panel.unlockSucces[panel.unlockSucces.Count - 1];
                }
            }

            GetComponent <RectTransform>().anchoredPosition = originalPos;
            toucMax = false;
            toucMin = false;

            //canTOuch = false;
            distance = Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 0)) - transform.position;
        }

        if (panel.page != 0)
        {
            if (Input.touchCount > 0)
            {
                touch = Input.GetTouch(0);
                if (touch.phase == TouchPhase.Began)
                {
                    touching = true;
                    distance = Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 0)) - transform.position;
                }
                else if (touch.phase == TouchPhase.Moved)
                {
                    Vector2 pos_move = Camera.main.ScreenToWorldPoint(new Vector2(touch.position.x, touch.position.y));
                    float   moveY    = pos_move.y - distance.y;
                    if (transform.position.y > minY && Vector2.Distance(lastSucces.transform.position, txt.position) > 1f && touching)
                    {
                        transform.position = new Vector2(originalPos.x, moveY);
                    }

                    else if (transform.position.y < minY)
                    {
                        transform.position = new Vector2(originalPos.x, -0.8862568f);
                        if (touching)
                        {
                            lastmoveDownY = moveY;
                        }
                        touching = false;
                        toucMin  = true;
                    }
                    else if (Vector2.Distance(lastSucces.transform.position, txt.position) < 1f)
                    {
                        transform.position = new Vector2(originalPos.x, transform.position.y - 1);
                        if (touching)
                        {
                            lastmoveUpY = moveY;
                        }
                        touching = false;
                        toucMax  = true;
                    }
                    else if (!touching)
                    {
                        if (moveY > lastmoveDownY && toucMin)
                        {
                            touching = true;
                            toucMin  = false;
                        }
                        else if (moveY < lastmoveUpY && toucMax)
                        {
                            touching = true;
                            toucMax  = false;
                        }
                    }
                }
            }
        }

        //if(Input.GetMouseButtonUp(0))
        //{
        //     canTOuch = true;
        //}
    }