public SubsidiaryCompany(SubsidiaryEntity _owner, bool initiallyOwned) { this.owner = _owner; this._isOwned = initiallyOwned; owner.onEntityRemoved += new EventHandler(onOwnerRemoved); updateCurrentPrice(); if (_isOwned) { SubsidiaryMarket.SELL.add(this); } registerClock(); }
protected bool IsReplaceable(Entity e, int comPrice) { comPrice = (int)(comPrice * F_ReplacePriceFactor); if (e.isOwned || e is ConstructionSite) { return(false); } if (e is SubsidiaryEntity) { SubsidiaryEntity se = e as SubsidiaryEntity; 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); }