Skip to content

Instantly share code, notes, and snippets.

@lfmundim
Created April 27, 2020 22:53
Show Gist options
  • Save lfmundim/d7ace0f310fbf3556e5abdeb1b49f48d to your computer and use it in GitHub Desktop.
Save lfmundim/d7ace0f310fbf3556e5abdeb1b49f48d to your computer and use it in GitHub Desktop.
public class Bird
{
    // whatever properties do birds have
    public BirdType Type { get; set; }

    public double GetSpeed()
    {
        switch(Type)
        {
            case African:
                // logic for African birds
            case American:
                // logic for American birds
            case European:
                // logic for European birds
            default:
                // default logic
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment