Skip to content

Instantly share code, notes, and snippets.

@charlieamat
Created March 6, 2017 17:52
Show Gist options
  • Save charlieamat/14d49fecc725d9c46ba08c7624dd2402 to your computer and use it in GitHub Desktop.
Save charlieamat/14d49fecc725d9c46ba08c7624dd2402 to your computer and use it in GitHub Desktop.
public class Player
{
private const double MaxPowerups = 2;
private Weapon _weapon;
public List<IPowerup> Powerups { get; } = new List<IPowerup>();
public double Damage => _weapon.Damage * Powerups.Take(MaxPowerups).Sum(p => p.Multiplier);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment