/// <summary> /// Check if ship is burning but only if caller of the function is this ship's status manager /// </summary> /// <param name="caller">Caller of the function</param> /// <returns>Status of ship being on fire</returns> public bool IsBurning(object caller) { ShipStatsManager manager = caller as ShipStatsManager; if (manager != null && manager.GetShip(this) == this) { return(onFire); } return(false); }
/// <summary> /// Get powerup ship is holding only if caller of the function is this ship's status manager /// </summary> /// <param name="caller">Caller of the function</param> /// <returns>Powerup ship is holding</returns> public PowerUpType GetPowerUp(object caller) { ShipStatsManager manager = caller as ShipStatsManager; if (manager != null && manager.GetShip(this) == this) { return(powerup); } return(PowerUpType.None); }
public void RemoveShip(Ship ship) { ShipStatsManager manager = shipsStats.FirstOrDefault(shipStat => shipStat.GetShip(this) == ship); if (manager != null) { manager.isDead = true; } _ships.Remove(ship); foreach (Ship aliveShip in _ships) { aliveShip.CheckDeadShip(ship); } if (_ships.Count < 2) { gameOver = true; } }