public string Beats(Beatable other) { switch (other) { case Rock r: return("scissor loses"); case Paper p: return("scissor wins"); default: return("draw"); } }
public string Beats(Beatable other) { switch (other) { case Paper p: return("rock loses"); case Scissor s: return("rock wins"); default: return("draw"); } }
public string Beats(Beatable other) { if (other.GetType() == typeof(Rock)) { return("scissor loses"); } if (other.GetType() == typeof(Paper)) { return("scissor wins"); } return("draw"); }