/// <summary> /// /// </summary> /// <param name="_owner"></param> /// <param name="initiallyOwned"></param> public SubsidiaryCompany(ISubsidiaryEntity _owner, bool initiallyOwned) { this.owner = _owner; this._isOwned = initiallyOwned; owner.onEntityRemoved += new EventHandler(onOwnerRemoved); updateCurrentPrice(); if (_isOwned) { SubsidiaryMarket.SELL.add(this); } registerClock(); }
/// <summary> /// /// </summary> /// <param name="e"></param> /// <param name="comPrice"></param> /// <returns></returns> protected bool IsReplaceable(IEntity e, int comPrice) { comPrice = (int)(comPrice * F_ReplacePriceFactor); if (e.isOwned || e is ConstructionSite) { return(false); } if (e is ISubsidiaryEntity) { ISubsidiaryEntity se = e as ISubsidiaryEntity; bool b = (se.structurePrice < comPrice || se.structurePrice < se.totalLandPrice); return(b); } else if (e is LandVoxel) { Debug.WriteLine("LandPrice:" + e.EntityValue + " (>" + comPrice); if (e.EntityValue > comPrice) { return(false); } } return(true); }