示例#1
0
        internal static Object ExecNonQuery(string spName, Databases sDb, ICollection <KeyValuePair <string, object> > param)
        {
            object        Gelen;
            IDbConnection cnn = DBSelect.CreateConnection(sDb);
            IDbCommand    cmd = CommandSelect.CreateCommand(sDb);

            if (cnn.State == ConnectionState.Open)
            {
                cnn.Close();
                cmd.Parameters.Clear();
            }

            cmd.CommandText = spName;

            foreach (KeyValuePair <string, object> item in param)
            {
                cmd.Parameters.Add(ParameterSelect.CreateParameter(sDb, item.Key, item.Value));
            }

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = cnn;

            if (cnn.State == ConnectionState.Closed)
            {
                cnn.Open();
            }

            Gelen = cmd.ExecuteNonQuery();

            return(Gelen);
        }
示例#2
0
        internal static Object ExecReader(string spName, Databases sDb, int?id, string param)
        {
            object        Gelen;
            IDbConnection cnn = DBSelect.CreateConnection(sDb);
            IDbCommand    cmd = CommandSelect.CreateCommand(sDb);

            if (cnn.State == ConnectionState.Open)
            {
                cnn.Close();
                cmd.Parameters.Clear();
            }
            cmd.CommandText = spName;

            var parameter = cmd.CreateParameter();

            parameter.ParameterName = param;
            parameter.Value         = id;
            cmd.Parameters.Add(parameter);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = cnn;

            if (cnn.State == ConnectionState.Closed)
            {
                cnn.Open();
            }


            Gelen = cmd.ExecuteReader();

            return(Gelen);
        }
示例#3
0
        internal static DataSet ExecDisconnected(string spName, Databases sDb)
        {
            DataSet ds = new DataSet();

            IDbConnection cnn = DBSelect.CreateConnection(sDb);
            IDbCommand    cmd = CommandSelect.CreateCommand(sDb);

            cmd.CommandText = spName;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = cnn;
            IDataAdapter adapter = AdapterSelect.CreateAdapter(sDb, cmd);

            adapter.Fill(ds);

            return(ds);
        }
    public void RotateCommandRight()
    {
        //Getting access to the ComandSelect global variables which are attached to the PlayterTerminalObject
        cs = GameObject.Find("PlayerTerminalObject").GetComponent <CommandSelect>();

        //When a pipe is magenta, the pipe is rotated clockwise of their original orientation
        if (selected)
        {
            if (this.RotationComponent.Rotation == RotationPipe.Rotations.NORTH)
            {
                this.RotationComponent.SetRotation(RotationPipe.Rotations.EAST);
            }

            else if (this.RotationComponent.Rotation == RotationPipe.Rotations.EAST)
            {
                this.RotationComponent.SetRotation(RotationPipe.Rotations.SOUTH);
            }
            else if (this.RotationComponent.Rotation == RotationPipe.Rotations.SOUTH)
            {
                this.RotationComponent.SetRotation(RotationPipe.Rotations.WEST);
            }
            else if (this.RotationComponent.Rotation == RotationPipe.Rotations.WEST)
            {
                this.RotationComponent.SetRotation(RotationPipe.Rotations.NORTH);
            }
            GameManager.Instance.SuccessCommands += 1;
            GameManager.Instance.TotalCommands   += 1;
            FindObjectOfType <AudioManager>().Play("R_Right");
        }
        //If no pipe is magenta and a command is passed, the FullSyntaxCommands and TotalCommands values increment by 1
        else
        {
            GameManager.Instance.FullSyntaxCommands += 1;
            GameManager.Instance.TotalCommands      += 1;
        }

        cs.TickDown();
        //When count becomes 0, the player loses the level and the lose screen is the only UI element visible
        if (cs.count == 0)
        {
            cs.loseScreen.SetActive(true);
            cs.GameCanvas.SetActive(false);
            GameObject.Find("Grid").SetActive(false);
            gs2.GetComponent <WinDetect>().enabled = false;
        }
    }
        public Command InterpretRequest(string command)
        {
            Command interpretation;

            if (command.Equals(TextCommands.REGISTER, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandRegister();
            }
            else if (command.Equals(TextCommands.LOGIN, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandLogin();
            }
            else if (command.Equals(TextCommands.LOGOUT, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandLogOut();
            }
            else if (command.Equals(TextCommands.JOINMATCH, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandJoin();
            }
            else if (command.Equals(TextCommands.SELECTCHARACTER, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandSelect();
            }
            else if (command.Equals(TextCommands.MOVE, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandMove();
            }
            else if (command.Equals(TextCommands.ATTACK, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandAttack();
            }
            else if (command.Equals(TextCommands.EXIT, StringComparison.InvariantCultureIgnoreCase))
            {
                interpretation = new CommandExit();
            }
            else
            {
                interpretation = new CommandUnknown();
            }
            return(interpretation);
        }
            void InitializeProperties()
            {
                SelectedTrim.Subscribe((v) => {
                    SetTrimSettingsWith(v);
                });
                Prologue.Subscribe((v) => {
                    UpdateButtonStatus();
                });
                Epilogue.Subscribe((v) => {
                    UpdateButtonStatus();
                });
                PrologueEnabled.Subscribe((v) => {
                    UpdateButtonStatus();
                });
                EpilogueEnabled.Subscribe((v) => {
                    UpdateButtonStatus();
                });
                TrimmingName.Subscribe((v) => {
                    UpdateButtonStatus();
                });
                Started.Subscribe((V) => {
                    UpdatePlayingState();
                });
                Pausing.Subscribe((v) => {
                    UpdatePlayingState();
                });
                Duration.Subscribe((v) => {
                });

                CommandRegister.Subscribe(ExecRegister);
                CommandApply.Subscribe(ExecApply);
                CommandUpdate.Subscribe(ExecUpdate);
                CommandUndo.Subscribe(ExecUndo);
                CommandCancel.Subscribe(ExecCancel);
                CommandSelect.Subscribe(ExecSelect);

                Rating.Subscribe(ChangeRating);
            }
示例#7
0
        internal static IDataReader ExecReader(string spName, Databases sDb)
        {
            IDataReader DataReader;

            IDbConnection cnn = DBSelect.CreateConnection(sDb);
            IDbCommand    cmd = CommandSelect.CreateCommand(sDb);

            if (cnn.State == ConnectionState.Open)
            {
                cnn.Close();
                cmd.Parameters.Clear();
            }



            if (cmd != null)
            {
                cnn.Close();
                cmd.Parameters.Clear();
            }


            cmd.CommandText = spName;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = cnn;

            if (cnn.State == ConnectionState.Closed)
            {
                cnn.Open();
            }

            DataReader = cmd.ExecuteReader();

            //DataReader.Close();

            return(DataReader);
        }
 public void SlideCommandLeft()
 {
     //Getting access to the ComandSelect global variables which are attached to the PlayterTerminalObject
     cs = GameObject.Find("PlayerTerminalObject").GetComponent <CommandSelect>();
     //When a pipe is magenta, the pipe is moved left by 1 unit on the grid
     if (selected)
     {
         for (int i = 0; i < CommandSelect.increment; i++)
         {
             collidedPipe1 = GameObject.Find("(" + (X - 1).ToString() + ", " + Y.ToString() + ")");
             gs2           = GameObject.Find("Grid").GetComponent <GridScript>();
             //These if/else conditionals check if there is a pipe or grid boundary that the selected pipe can collide with
             if (collidedPipe1 == null && X > 0)
             {
                 this.MovableComponent.Move(X - 1, Y);
                 pipe1Name = pipe1.name;
                 CommandSelect.collideInput = true;
             }
             else if (collidedPipe1 != null)
             {
                 Debug.Log(collidedPipe1.name);
                 CommandSelect.collideInput = false;
             }
             else
             {
                 CommandSelect.borderInput = true;
             }
         }
         //The Command global variables from GameManager update based on if the selected pipe does or doesn't collide with other objects.
         if (CommandSelect.collideInput == false)
         {
             GameManager.Instance.FullSyntaxCommands += 1;
             GameManager.Instance.TotalCommands      += 1;
         }
         else if (CommandSelect.borderInput == true)
         {
             GameManager.Instance.FullSyntaxCommands += 1;
             GameManager.Instance.TotalCommands      += 1;
         }
         else if (CommandSelect.collideInput == true)
         {
             GameManager.Instance.SuccessCommands += 1;
             GameManager.Instance.TotalCommands   += 1;
         }
     }
     //If no pipe is magenta and a command is passed, the FullSyntaxCommands and TotalCommands values increment by 1
     else
     {
         GameManager.Instance.FullSyntaxCommands += 1;
         GameManager.Instance.TotalCommands      += 1;
     }
     FindObjectOfType <AudioManager>().Play("Slide_Normal");
     cs.TickDown();
     //When count becomes 0, the player loses the level and the lose screen is the only UI element visible
     if (cs.count == 0)
     {
         cs.loseScreen.SetActive(true);
         cs.GameCanvas.SetActive(false);
         GameObject.Find("Grid").SetActive(false);
         gs2.GetComponent <WinDetect>().enabled = false;
     }
 }