Example #1
0
        private Bitmap CreateStructuresMap()
        {
            return(_zone.CreateBitmap().WithGraphics(g =>
            {
                foreach (var unit in _zone.GetStaticUnits())
                {
                    var size = 3;
                    var pen = Pens.White;

                    if (unit.IsCategory(CategoryFlags.cf_outpost))
                    {
                        pen = Pens.LightSeaGreen;
                        size = 150;
                    }
                    else if (unit.IsCategory(CategoryFlags.cf_public_docking_base))
                    {
                        pen = Pens.Yellow;
                        size = 150;
                    }
                    else if (unit.IsCategory(CategoryFlags.cf_teleport_column))
                    {
                        pen = Pens.WhiteSmoke;
                        size = 100;
                    }

                    var x = unit.CurrentPosition.intX - (size / 2);
                    var y = unit.CurrentPosition.intY - (size / 2);

                    g.DrawEllipse(pen, x, y, size, size);
                }
            }));
        }
        private void DamageWall()
        {
            if (_zone.Configuration.IsAlpha)
            {
                return; //nothing to do on alpha
            }
            //on gamma we have to collect pbs data
            if (_zone.Configuration.IsGamma)
            {
                var searchRadius = DistanceConstants.TERRAIN_DEGRADE_DISTANCE_FROM_PBS + Math.Max(_area.Width, _area.Height);
                _intactDistance      = (int)(DistanceConstants.TERRAIN_DEGRADE_DISTANCE_FROM_PBS * PBSHelper.DEGRADE_NEAR_BIAS);
                _wallDistanceFromPBS = (int)DistanceConstants.TERRAIN_DEGRADE_DISTANCE_FROM_PBS;
                _gradientRange       = _wallDistanceFromPBS - _intactDistance;
                _pbsPositions        = _zone.GetStaticUnits().Where(o => o is IPBSObject && o.CurrentPosition.TotalDistance2D(_area.Center) < searchRadius).Select(o => o.CurrentPosition).ToList();
            }


            //on beta and gamma it will run
            ForEachInCube((int x, int y, ref PlantInfo plantInfo, ref BlockingInfo blockingInfo) => DamageWallOnTile(ref plantInfo, ref blockingInfo, x, y));
        }
Example #3
0
 public static IEnumerable <TeleportColumn> GetTeleportColumns(this IZone zone)
 {
     return(zone.GetStaticUnits().OfType <TeleportColumn>());
 }