public object Clone() { var shipConfig = new ShipConfig(); shipConfig.ID = this.ID; shipConfig.Length = this.Length; shipConfig.Count = this.Count; return(shipConfig); }
public bool ForceKillShip(Point point) { var ship = GetShipAtPoint(point); if (ship == null) { return(false); } ShipConfig currentConf = null; foreach (var conf in GameConfig.shipConfigs) { if (conf.Length == ship.Length) { currentConf = conf; break; } } if (currentConf == null) { return(false); } Ship nShip = new Ship(currentConf); nShip.Orientation = ship.Orientation; nShip.Position = ship.Position; nShip.Status = ShipStatus.Dead; foreach (var pp in nShip.GetOwnNeededSpace().AllPoints()) { nShip.DamagePoint(pp); } ForceDeleteShip(ship); ForceAddShip(nShip); return(true); }
public Ship(ShipConfig config) { this.ConfigID = config.ID; this.Length = config.Length; }