Created
January 27, 2020 23:30
-
-
Save GarethOates/40a1549309952538420e6919b16c0076 to your computer and use it in GitHub Desktop.
A more generic equipment class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace MagicTheProgramming | |
{ | |
public class Weapon : CreatureDecorator, ICreature | |
{ | |
protected int _powermodifier; | |
protected int _toughnessmodifier; | |
public Weapon(ICreature creature, int powermod, int toughnessmod) | |
: base(creature) { | |
this._powermodifier = powermod; | |
this._toughnessmodifier = toughnessmod; | |
} | |
public override int Toughness => base.Toughness + _toughnessmodifier; | |
public override int Power => base.Power + _powermodifier; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment