Пример #1
0
  public void hitShields(Projectile projectile) {
    ShieldSystem shields = (ShieldSystem) systems.get("shields");

    if (shields.getShieldLvl() > 0) {
      shields.hitShields(projectile);
    } else {
      System.out.println("no shields to protect from projectile");
    }
  }
Пример #2
0
  public int getShieldLvl() {
    ShieldSystem shields = (ShieldSystem) systems.get("shields");

    if (shields != null) {
      return shields.getShieldLvl();
    }

    return 0;
  }