public string Weapon { get; set; }
public string Name { get; set; }
public Hero(string name) {
Weapon = "pair of fists";
public virtual void Attack() {
Console.WriteLine("Punch Punch!");
public Rogue(string name) : base(name) {
public override void Attack() {
Console.WriteLine("Stab Stab!");
public Archer(string name) : base(name) {
public override void Attack() {
Console.WriteLine("Pew Pew!");
public Warrior(string name) : base(name) {
public override void Attack() {
Console.WriteLine("Slash Slash!");
public static void Main() {
Hero avatar = new Rogue("Bob");
Console.WriteLine("{0}'s weapon is a {1}.", avatar.Name, avatar.Weapon);