예제 #1
0
    public void ReturnFromRegistration()
    {
        HeadingText.GetComponent <TextMeshProUGUI>().text = "User Login";
        LoginButton.SetActive(true);
        LoginButtonCover.SetActive(true);
        UserLoginText.SetActive(true);
        PasswordText.SetActive(true);
        RegisterButton.SetActive(true);
        //RegisterName, RegisterPassword, RegisterLocation, RegisterAge, SubmitCoverButton, SubmitButton;
        RegisterName.SetActive(false);
        RegisterPassword.SetActive(false);
        RegisterLocation.SetActive(false);
        RegisterAge.SetActive(false);
        SubmitCoverButton.SetActive(false);
        SubmitButton.SetActive(false);
        Registering = false;

        if (netManager)
        {
            if (netManager.IsConnectedToServer())
            {
                netManager.AttemptAccountCreation(RegisterName.GetComponent <TMP_InputField>().text, RegisterPassword.GetComponent <TMP_InputField>().text);
            }
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!loggingIn && !loggedIn && !Registering)
        {
            if (UserLoginText.GetComponent <TMP_InputField>().text != "" &&
                PasswordText.GetComponent <TMP_InputField>().text != "")
            {
                LoginButton.SetActive(true);
                LoginButtonCover.SetActive(false);
            }
            else
            {
                LoginButton.SetActive(false);
                LoginButtonCover.SetActive(true);
            }
        }

        if (Registering)
        {
            if (RegisterName.GetComponent <TMP_InputField>().text != "" &&
                RegisterPassword.GetComponent <TMP_InputField>().text != "" &&
                RegisterAge.GetComponent <TMP_InputField>().text != "" &&
                RegisterLocation.GetComponent <TMP_InputField>().text != "")
            {
                SubmitCoverButton.SetActive(false);
                SubmitButton.SetActive(true);
            }
            else
            {
                SubmitCoverButton.SetActive(true); SubmitButton.SetActive(false);
            }
        }


        if (loggingIn)
        {
            if (loginConfirmed)
            {
                fakeLoginCount++;
                if (fakeLoginCount > 180)
                {
                    LoggedIn();
                    loggingIn      = false;
                    fakeLoginCount = 0;
                }
            }
        }

        if (loginFailed)
        {
            errorCount++;
            if (errorCount > 250)
            {
                loginFailed = false;
                errorCount  = 0;
                ErrorMessageBacking.SetActive(false);
                ErrorMessageText.SetActive(false);
            }
        }
    }
예제 #3
0
 public RegisterReference(RegisterLocation location, RegisterType type, int index, ComplexRegisterPart part)
 {
     this.RegisterLocation    = location;
     this.RegisterType        = type;
     this.RegisterIndex       = index;
     this.ComplexRegisterPart = part;
     this.JumpLabel           = null;
 }
예제 #4
0
 public RegisterReference(int jumpLine, string label)
 {
     this.ComplexRegisterPart = ComplexRegisterPart.Full;
     this.RegisterLocation    = RegisterLocation.Input;
     this.RegisterType        = RegisterType.Integer;
     this.RegisterIndex       = jumpLine;
     this.JumpLabel           = label;
 }
예제 #5
0
        /// <inheritdoc />
        public override void Visit(RegisterLocation registerLocation)
        {
            Write(":").WriteSpace();
            Write("register(");
            if (registerLocation.Profile != null)
            {
                Write(registerLocation.Profile);
                Write(",").WriteSpace();
            }

            Write(registerLocation.Register);
            Write(")");
        }
예제 #6
0
        public RegisterReference(string compact)
        {
            string name = compact.ToLowerInvariant().Trim(' ', '\t');

            this.ComplexRegisterPart = ComplexRegisterPart.Full;

            foreach (Pair pair in registersComplexParts)
            {
                if (name.EndsWith(pair.Key))
                {
                    ComplexRegisterPart currentPart;
                    if (Enum.TryParse(pair.Member, out currentPart))
                    {
                        this.ComplexRegisterPart = currentPart;
                    }
                    name = name.Remove(name.Length - pair.Key.Length);
                    break;
                }
            }
            while (name.Length > 1 && char.IsDigit(name[name.Length - 1]))
            {
                name = name.Remove(name.Length - 1);
            }
            //ii, ir, ic, i, r, c, oi, or, oc
            switch (name)
            {
            case "ii": this.RegisterLocation = RegisterLocation.Input; this.RegisterType = RegisterType.Integer; break;

            case "ir": this.RegisterLocation = RegisterLocation.Input; this.RegisterType = RegisterType.Real; break;

            case "ic": this.RegisterLocation = RegisterLocation.Input; this.RegisterType = RegisterType.Complex; break;

            case "i": this.RegisterLocation = RegisterLocation.Work; this.RegisterType = RegisterType.Integer; break;

            case "r": this.RegisterLocation = RegisterLocation.Work; this.RegisterType = RegisterType.Real; break;

            case "c": this.RegisterLocation = RegisterLocation.Work; this.RegisterType = RegisterType.Complex; break;

            case "oi": this.RegisterLocation = RegisterLocation.Output; this.RegisterType = RegisterType.Integer; break;

            case "or": this.RegisterLocation = RegisterLocation.Output; this.RegisterType = RegisterType.Real; break;

            case "oc": this.RegisterLocation = RegisterLocation.Output; this.RegisterType = RegisterType.Complex; break;

            default: throw new InvalidOperationException();
            }
            this.RegisterIndex = int.Parse(compact.Substring(name.Length));
            this.JumpLabel     = null;
        }
예제 #7
0
 public void StartRegistration()
 {
     LoginButton.SetActive(false);
     LoginButtonCover.SetActive(false);
     UserLoginText.SetActive(false);
     PasswordText.SetActive(false);
     HeadingText.GetComponent <TextMeshProUGUI>().text = "Register New Profile";
     RegisterButton.SetActive(false);
     //RegisterName, RegisterPassword, RegisterLocation, RegisterAge, SubmitCoverButton, SubmitButton;
     RegisterName.SetActive(true);
     RegisterPassword.SetActive(true);
     RegisterLocation.SetActive(true);
     RegisterAge.SetActive(true);
     SubmitCoverButton.SetActive(true);
     Registering = true;
 }
        public void RegisterLocationTest()
        {
            Location location3 = new Location
            {
                LocationId = 3,
                Address    = "Av. Jamas 3",
                City       = "Arequipa"
            };

            mockRepository.Setup(x => x.RegisterLocation(location3))
            .Returns(true);

            var handler         = new RegisterLocationHandler(mockRepository.Object);
            RegisterLocation rc = new RegisterLocation(location3);
            var res             = handler.Handle(rc, ct);

            Assert.IsTrue(res.Result);
        }
예제 #9
0
        private ConstantBufferSyntax ParseConstantBuffer()
        {
            var attributes = ParseAttributes();

            var cbuffer = NextToken();
            var name    = Match(SyntaxKind.IdentifierToken);

            RegisterLocation register = null;

            if (Current.Kind == SyntaxKind.ColonToken && Lookahead.Kind == SyntaxKind.RegisterKeyword)
            {
                register = ParseRegisterLocation();
            }

            var openBrace = Match(SyntaxKind.OpenBraceToken);

            var fields = new List <VariableDeclarationStatementSyntax>();

            while (Current.Kind != SyntaxKind.CloseBraceToken)
            {
                if (IsPossibleVariableDeclarationStatement())
                {
                    fields.Add(ParseVariableDeclarationStatement());
                }
                else
                {
                    var action = SkipBadTokens(
                        p => !p.IsPossibleVariableDeclarationStatement(),
                        p => p.IsTerminator(),
                        SyntaxKind.CloseBraceToken);
                    if (action == PostSkipAction.Abort)
                    {
                        break;
                    }
                }
            }

            var closeBrace = Match(SyntaxKind.CloseBraceToken);
            var semicolon  = NextTokenIf(SyntaxKind.SemiToken);

            return(new ConstantBufferSyntax(attributes, cbuffer, name, register, openBrace, fields, closeBrace, semicolon));
        }
        private ConstantBufferSyntax ParseConstantBuffer()
        {
            var cbuffer = NextToken();
            var name    = Match(SyntaxKind.IdentifierToken);

            RegisterLocation register = null;

            if (Current.Kind == SyntaxKind.ColonToken && Lookahead.Kind == SyntaxKind.RegisterKeyword)
            {
                register = ParseRegisterLocation();
            }

            var openBrace = Match(SyntaxKind.OpenBraceToken);

            var declarations = new List <SyntaxNode>();

            ParseTopLevelDeclarations(declarations, SyntaxKind.CloseBraceToken);

            var closeBrace = Match(SyntaxKind.CloseBraceToken);
            var semicolon  = NextTokenIf(SyntaxKind.SemiToken);

            return(new ConstantBufferSyntax(cbuffer, name, register, openBrace, declarations, closeBrace, semicolon));
        }
예제 #11
0
 public override void VisitRegisterLocation(RegisterLocation node)
 {
     CreateTag(node.Register, HlslClassificationTypeNames.RegisterLocation);
     base.VisitRegisterLocation(node);
 }
예제 #12
0
 /// <inheritdoc />
 public override void Visit(RegisterLocation registerLocation)
 {
 }
예제 #13
0
 public override void VisitRegisterLocation(RegisterLocation node)
 {
     CreateTag(node.Register, _classificationService.RegisterLocation);
     base.VisitRegisterLocation(node);
 }
예제 #14
0
 public virtual void VisitRegisterLocation(RegisterLocation node)
 {
     DefaultVisit(node);
 }
예제 #15
0
 public virtual void VisitRegisterLocation(RegisterLocation node)
 {
     DefaultVisit(node);
 }
예제 #16
0
 public override void VisitRegisterLocation(RegisterLocation node)
 {
     CreateTag(node.Register, _classificationService.RegisterLocation);
     base.VisitRegisterLocation(node);
 }
 public override int GetHashCode()
 {
     return(RegisterLocation.GetHashCode() ^ ActuallyLocation.GetHashCode());
 }