Beispiel #1
0
        private void AddTheaterZones()
        {
            var invertCoalition = Template.OptionsMission.Contains("InvertCountriesCoalitions");
            var red             = SituationDB.GetRedZone(invertCoalition);
            var redColour       = Template.OptionsMission.Contains("HideBorders") ? DrawingColour.Clear :  DrawingColour.RedFill;

            var blue       = SituationDB.GetBlueZone(invertCoalition);
            var blueColour = Template.OptionsMission.Contains("HideBorders") ? DrawingColour.Clear :  DrawingColour.BlueFill;

            AddFree(
                "Red Control",
                red.First(),
                "Points".ToKeyValuePair(red.Select(coord => coord - red.First()).ToList()),
                "Colour".ToKeyValuePair(redColour),
                "FillColour".ToKeyValuePair(redColour));
            AddFree(
                "Blue Control",
                blue.First(),
                "Points".ToKeyValuePair(blue.Select(coord => coord - blue.First()).ToList()),
                "Colour".ToKeyValuePair(blueColour),
                "FillColour".ToKeyValuePair(blueColour));

            if (SituationDB.NoSpawnCoordinates != null)
            {
                var noSpawn       = SituationDB.NoSpawnCoordinates;
                var noSpawnColour = Template.OptionsMission.Contains("HideBorders") ? DrawingColour.Clear :  DrawingColour.GreenFill;
                AddFree(
                    "Neutural (NoSpawning)",
                    noSpawn.First(),
                    "Points".ToKeyValuePair(noSpawn.Select(coord => coord - noSpawn.First()).ToList()),
                    "Colour".ToKeyValuePair(noSpawnColour),
                    "FillColour".ToKeyValuePair(noSpawnColour));
            }

            // DEBUG water
            AddFree(
                "Water",
                TheaterDB.WaterCoordinates.First(),
                "Points".ToKeyValuePair(TheaterDB.WaterCoordinates.Select(coord => coord - TheaterDB.WaterCoordinates.First()).ToList()),
                "Colour".ToKeyValuePair(DrawingColour.Clear),
                "FillColour".ToKeyValuePair(DrawingColour.Clear));

            foreach (var item in TheaterDB.WaterExclusionCoordinates)
            {
                AddFree(
                    "Water Exclusion",
                    item.First(),
                    "Points".ToKeyValuePair(item.Select(coord => coord - item.First()).ToList()),
                    "Colour".ToKeyValuePair(DrawingColour.Clear),
                    "FillColour".ToKeyValuePair(DrawingColour.Clear));
            }
        }
Beispiel #2
0
        private bool CheckNotInHostileCoords(Coordinates coordinates, Coalition?coalition = null)
        {
            if (!coalition.HasValue)
            {
                return(true);
            }

            var red  = SituationDB.GetRedZone(InvertCoalition);
            var blue = SituationDB.GetBlueZone(InvertCoalition);

            if (coalition.Value == Coalition.Blue)
            {
                return(!ShapeManager.IsPosValid(coordinates, red));
            }
            return(!ShapeManager.IsPosValid(coordinates, blue));
        }