Skip to content

Instantly share code, notes, and snippets.

@GarethOates
Created January 27, 2020 23:01
Show Gist options
  • Select an option

  • Save GarethOates/86c210c46fdda3a8e4542bccaaaeef2a to your computer and use it in GitHub Desktop.

Select an option

Save GarethOates/86c210c46fdda3a8e4542bccaaaeef2a to your computer and use it in GitHub Desktop.

Revisions

  1. Gareth Oates created this gist Jan 27, 2020.
    18 changes: 18 additions & 0 deletions CreatureDecorator.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    using System;

    namespace MagicTheProgramming
    {
    public class CreatureDecorator : ICreature
    {
    protected ICreature _creature;

    public CreatureDecorator(ICreature creature)
    {
    this._creature = creature;
    }

    public virtual string Name => _creature.Name;
    public virtual int Power => _creature.Power;
    public virtual int Toughness => _creature.Toughness;
    }
    }