JumpType.FindIfIsPredefined C# (CSharp) Method

FindIfIsPredefined() public method

public FindIfIsPredefined ( ) : bool
return bool
    public override bool FindIfIsPredefined()
    {
        string [] predefinedTests = {
            "Free", "SJ", "CMJ", "ABK", "Rocket",
            "SJl", "CMJl", "slCMJleft", "slCMJright", "ABKl", "DJa", "DJna",
            "RJ(j)", "RJ(t)", "RJ(unlimited)",
            "RJ(hexagon)", "triple jump"
        };

        foreach(string search in predefinedTests)
            if(this.name == search)
                return true;

        return false;
    }

Usage Example

Example #1
0
    public static JumpType SelectAndReturnJumpType(string typeName, bool dbconOpened)
    {
        if (!dbconOpened)
        {
            Sqlite.Open();
        }
        dbcmd.CommandText = "SELECT * " +
                            " FROM " + Constants.JumpTypeTable + " " +
                            " WHERE name  = \"" + typeName +
                            "\" ORDER BY uniqueID";

        LogB.SQL(dbcmd.CommandText.ToString());
        dbcmd.ExecuteNonQuery();
        SqliteDataReader reader;

        reader = dbcmd.ExecuteReader();

        JumpType myJumpType = new JumpType();

        while (reader.Read())
        {
            myJumpType.Name        = reader[1].ToString();
            myJumpType.StartIn     = Util.IntToBool(Convert.ToInt32(reader[2].ToString()));
            myJumpType.HasWeight   = Util.IntToBool(Convert.ToInt32(reader[3].ToString()));
            myJumpType.Description = reader[4].ToString();
        }

        myJumpType.IsPredefined = myJumpType.FindIfIsPredefined();

        reader.Close();
        if (!dbconOpened)
        {
            Sqlite.Close();
        }

        return(myJumpType);
    }
All Usage Examples Of JumpType::FindIfIsPredefined