public Player ApplyUpgrade(Upgrade u) { UpgradeType type = u.Type; switch (type) { case UpgradeType.BombUp: BombCount++; break; case UpgradeType.ChangeDirection: InvertedDirections = true; break; case UpgradeType.Kick: CanKick = true; break; case UpgradeType.PowerDown: BombPower--; break; case UpgradeType.PowerMax: BombPower = Game.Length; break; case UpgradeType.PowerUp: BombPower++; break; case UpgradeType.SpeedDown: Speed--; break; case UpgradeType.SpeedMax: //TODO: choose a maximum speed break; case UpgradeType.SpeedUp: Speed++; break; case UpgradeType.Teleport: //Managed by the Game class break; } return this; }
public bool PickupUpgrade(Upgrade upgrade) { return ListOfUpgrade.Remove(upgrade); }
public Player AddAndApplyUpgrade(Upgrade u) { _upgrades.Add(u); return ApplyUpgrade(u); }