protected override void EditCell(IHexCell cell)
 {
     if (IsPainting && ModLogic.CanChangeFeatureOfCell(cell, ActiveFeature))
     {
         ModLogic.ChangeFeatureOfCell(cell, ActiveFeature);
     }
 }
示例#2
0
        public void RazeCity(ICity city)
        {
            var cityLocation = CityLocationCanon.GetOwnerOfPossession(city);

            city.Destroy();

            if (cityLocation.Feature == CellFeature.None && CellModLogic.CanChangeFeatureOfCell(cityLocation, CellFeature.CityRuins))
            {
                CellModLogic.ChangeFeatureOfCell(cityLocation, CellFeature.CityRuins);
            }
        }
        private bool OasisCandidateFilter(IHexCell cell, MapRegion region)
        {
            if (cell.Terrain == CellTerrain.Desert && ModLogic.CanChangeFeatureOfCell(cell, CellFeature.Oasis))
            {
                bool surroundedByLand = Grid.GetNeighbors(cell).All(
                    neighbor => !neighbor.Terrain.IsWater()
                    );

                bool hasResourceNode = NodePositionCanon.GetPossessionsOfOwner(cell).Any();

                return(surroundedByLand && !hasResourceNode);
            }
            else
            {
                return(false);
            }
        }