Пример #1
0
    /// <summary>
    /// Toggle shot mode based on current mode and club.
    /// </summary>
    public void Toggle()
    {
        ClubType clubType = game.GetBag().GetClub().GetClubType();

        if (mode == Mode.NORMAL)
        {
            mode = Mode.POWER;
        }
        else if (mode == Mode.POWER)
        {
            if (clubType.GetClubClass() == ClubClass.WEDGE)
            {
                mode = Mode.APPROACH;
            }
            else
            {
                mode = Mode.NORMAL;
            }
        }
        else if (mode == Mode.APPROACH)
        {
            mode = Mode.NORMAL;
        }
        else
        {
            throw new Exception("Unexpected shot Mode");
        }
    }
Пример #2
0
    /// <summary>
    /// Validate that shot mode and club combo is valid. Correct otherwise.
    /// </summary>
    public void Validate()
    {
        ClubType clubType = game.GetBag().GetClub().GetClubType();

        if (mode == Mode.APPROACH && clubType.GetClubClass() != ClubClass.WEDGE)
        {
            mode = Mode.NORMAL;
        }
    }
Пример #3
0
 public ClubClass GetClubClass()
 {
     return(type.GetClubClass());
 }