示例#1
0
 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;
 }
示例#2
0
 public bool PickupUpgrade(Upgrade upgrade)
 {
     return ListOfUpgrade.Remove(upgrade);
 }
示例#3
0
 public Player AddAndApplyUpgrade(Upgrade u)
 {
     _upgrades.Add(u);
     return ApplyUpgrade(u);
 }