Пример #1
0
        public VarHeightBuilding(VarHeightBuildingContribution _type, WorldLocator wloc,
                                 int _height, bool initiallyOwned)
        {
            this.type   = _type;
            this.height = _height;

            int Y = type.size.y;
            int X = type.size.x;
            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 == World.world)
            {
                this.subsidiary = new SubsidiaryCompany(this, initiallyOwned);
            }

            if (type.population != null)
            {
                stationListener = new StationListenerImpl(
                    new MultiplierPopulation(height, type.population), baseLocation);
            }
        }
Пример #2
0
 public PopulatedStructure(FixedSizeStructureContribution type, WorldLocator wloc)
     : base(type, wloc)
 {
     if (type.population != null && wloc.world == World.world)
     {
         stationListener = new StationListenerImpl(type.population, wloc.location);
     }
 }