/// <summary> /// /// </summary> /// <param name="_type"></param> /// <param name="wloc"></param> /// <param name="_height"></param> /// <param name="initiallyOwned"></param> public VarHeightBuilding(VarHeightBuildingContribution _type, WorldLocator wloc, int _height, bool initiallyOwned) { this.type = _type; this.height = _height; int Y = type.Size.Height; int X = type.Size.Width; int Z = height; this.baseLocation = wloc.location; voxels = new VoxelImpl[X, Y, Z]; for (int z = 0; z < Z; z++) { for (int y = 0; y < Y; y++) { for (int x = 0; x < X; x++) { WorldLocator wl = new WorldLocator(wloc.world, baseLocation + new Distance(x, y, z)); voxels[x, y, z] = new VoxelImpl(this, (byte)x, (byte)y, (byte)z, wl); } } } if (wloc.world == WorldDefinition.World) { this.subsidiary = new SubsidiaryCompany(this, initiallyOwned); } if (type.Population != null) { stationListener = new StationListenerImpl( new MultiplierPopulation(height, type.Population), baseLocation); } }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="wloc"></param> public PopulatedStructure(FixedSizeStructureContribution type, WorldLocator wloc) : base(type, wloc) { if (type.Population != null && wloc.world == WorldDefinition.World) { stationListener = new StationListenerImpl(type.Population, wloc.location); } }