Пример #1
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);
     }
 }
Пример #2
0
        public PThreeDimStructure(FixedSizeStructureContribution type, WorldLocator wloc)
        {
            this.baseLocation = wloc.location;
            this.type         = type;

            // build voxels
            for (int z = 0; z < type.size.z; z++)
            {
                for (int y = 0; y < type.size.y; y++)
                {
                    for (int x = 0; x < type.size.x; x++)
                    {
                        CreateVoxel(new WorldLocator(wloc.world, baseLocation + new Distance(x, y, z)));
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Builds a new structure.
        /// </summary>
        /// <param name="_type">type of this structure</param>
        /// <param name="loc">location of the left-top corner</param>
        public TwoDimStructure(FixedSizeStructureContribution _type, Location loc)
        {
            this.type = _type;

            int Y = type.size.y;
            int X = type.size.x;

            voxels = new StructureVoxel[Y, X];
            for (int y = 0; y < Y; y++)
            {
                for (int x = 0; x < X; x++)
                {
                    Location l = loc;
                    l.x         += x; l.y += y;
                    voxels[y, x] = new SimpleStructureVoxel(this, (byte)x, (byte)y, l);
                }
            }
            this.baseLocation = loc;
        }
 internal CompletionHandler(FixedSizeStructureContribution contribution, Location loc, bool owned)
 {
     this.contribution = contribution;
     this.loc          = loc;
     this.owned        = owned;
 }