public SectionSubdivisionLogic(
     IHexGrid grid, IWeightedRandomSampler <MapSection> mapSectionRandomSampler
     )
 {
     Grid = grid;
     MapSectionRandomSampler = mapSectionRandomSampler;
 }
示例#2
0
        public ResourceBalanceStrategy(
            IYieldEstimator yieldEstimator, IResourceNodeFactory resourceNodeFactory,
            IResourceRestrictionLogic resourceRestrictionCanon, ICellScorer cellScorer, ITechCanon techCanon,
            IStrategicCopiesLogic strategicCopiesLogic, IWeightedRandomSampler <IHexCell> cellRandomSampler,
            [Inject(Id = "Available Resources")] IEnumerable <IResourceDefinition> availableResources,
            IWeightedRandomSampler <IResourceDefinition> resourceRandomSampler
            )
        {
            YieldEstimator           = yieldEstimator;
            ResourceNodeFactory      = resourceNodeFactory;
            ResourceRestrictionCanon = resourceRestrictionCanon;
            CellScorer            = cellScorer;
            TechCanon             = techCanon;
            StrategicCopiesLogic  = strategicCopiesLogic;
            CellRandomSampler     = cellRandomSampler;
            ResourceRandomSampler = resourceRandomSampler;

            foreach (var yieldType in EnumUtil.GetValues <YieldType>())
            {
                BonusResourcesWithYield[yieldType] = availableResources.Where(
                    resource => resource.Type == ResourceType.Bonus &&
                    YieldEstimator.GetYieldEstimateForResource(resource)[yieldType] > 0f
                    ).ToArray();
            }

            ScoreIncreasingCandidates = availableResources.Where(resource => resource.Type != ResourceType.Luxury).ToList();
        }
示例#3
0
 public HomelandBalancer(
     IYieldEstimator yieldEstimator, ICellScorer cellScorer, ITechCanon techCanon,
     IWeightedRandomSampler <IBalanceStrategy> balanceStrategySampler
     )
 {
     YieldEstimator         = yieldEstimator;
     CellScorer             = cellScorer;
     TechCanon              = techCanon;
     BalanceStrategySampler = balanceStrategySampler;
 }
 public VegetationPainter(
     ICellModificationLogic modLogic, IHexGrid grid, IRiverCanon riverCanon,
     IGridTraversalLogic gridTraversalLogic, IWeightedRandomSampler <IHexCell> cellRandomSampler
     )
 {
     ModLogic           = modLogic;
     Grid               = grid;
     RiverCanon         = riverCanon;
     GridTraversalLogic = gridTraversalLogic;
     CellRandomSampler  = cellRandomSampler;
 }
示例#5
0
 public BarbarianEncampmentSpawner(
     IEncampmentFactory encampmentFactory, IHexGrid grid, IWeightedRandomSampler <IHexCell> cellSampler,
     IBarbarianSpawningTools spawningTools, IBarbarianUnitSpawner unitSpawner
     )
 {
     EncampmentFactory = encampmentFactory;
     Grid          = grid;
     CellSampler   = cellSampler;
     SpawningTools = spawningTools;
     UnitSpawner   = unitSpawner;
 }
示例#6
0
 public LuxuryDistributor(
     IResourceRestrictionLogic resourceRestrictionCanon, IMapGenerationConfig config,
     IResourceNodeFactory nodeFactory, IWeightedRandomSampler <IHexCell> cellRandomSampler,
     IWeightedRandomSampler <IResourceDefinition> resourceRandomSampler
     )
 {
     ResourceRestrictionCanon = resourceRestrictionCanon;
     Config                = config;
     NodeFactory           = nodeFactory;
     CellRandomSampler     = cellRandomSampler;
     ResourceRandomSampler = resourceRandomSampler;
 }
示例#7
0
 public BarbarianWanderBrain(
     IHexGrid grid, IUnitPositionCanon unitPositionCanon, DiContainer container,
     IWeightedRandomSampler <IHexCell> cellRandomSampler, IBarbarianBrainWeightLogic brainTools,
     IBarbarianConfig barbarianConfig
     )
 {
     Grid = grid;
     UnitPositionCanon = unitPositionCanon;
     Container         = container;
     CellRandomSampler = cellRandomSampler;
     BrainTools        = brainTools;
     BarbarianConfig   = barbarianConfig;
 }
示例#8
0
 public RegionGenerator(
     ICellModificationLogic modLogic, IHexGrid grid, IMapGenerationConfig config,
     ICellClimateLogic cellClimateLogic, IWeightedRandomSampler <IHexCell> cellRandomSampler,
     IRiverCanon riverCanon
     )
 {
     ModLogic          = modLogic;
     Grid              = grid;
     Config            = config;
     CellClimateLogic  = cellClimateLogic;
     CellRandomSampler = cellRandomSampler;
     RiverCanon        = riverCanon;
 }
示例#9
0
 public OceanGenerator(
     ICellModificationLogic modLogic, IRegionGenerator regionGenerator,
     ITemplateSelectionLogic templateSelectionLogic, IHexGrid grid,
     List <IBalanceStrategy> availableBalanceStrategies,
     IWeightedRandomSampler <MapSection> mapSectionRandomSampler
     )
 {
     ModLogic               = modLogic;
     RegionGenerator        = regionGenerator;
     TemplateSelectionLogic = templateSelectionLogic;
     Grid = grid;
     AvailableBalanceStrategies = availableBalanceStrategies;
     MapSectionRandomSampler    = mapSectionRandomSampler;
 }
示例#10
0
        public RiverGenerator(
            IHexGrid grid, IRiverCanon riverCanon, ICellModificationLogic modLogic,
            IMapGenerationConfig config, IHexPathfinder hexPathfinder,
            IWeightedRandomSampler <IHexCell> cellRandomSampler

            )
        {
            Grid              = grid;
            RiverCanon        = riverCanon;
            ModLogic          = modLogic;
            Config            = config;
            HexPathfinder     = hexPathfinder;
            CellRandomSampler = cellRandomSampler;
        }
 public OasisBalanceStrategy(
     IHexGrid grid, IYieldEstimator yieldEstimator, ITechCanon techCanon,
     IMapScorer mapScorer, ICellModificationLogic modLogic,
     IPossessionRelationship <IHexCell, IResourceNode> nodePositionCanon,
     IWeightedRandomSampler <IHexCell> cellRandomSampler
     )
 {
     Grid              = grid;
     YieldEstimator    = yieldEstimator;
     TechCanon         = techCanon;
     MapScorer         = mapScorer;
     ModLogic          = modLogic;
     NodePositionCanon = nodePositionCanon;
     CellRandomSampler = cellRandomSampler;
 }
示例#12
0
        public StrategicDistributor(
            IResourceNodeFactory nodeFactory, IResourceRestrictionLogic resourceRestrictionCanon,
            IStrategicCopiesLogic strategicCopiesLogic, IWeightedRandomSampler <IHexCell> cellRandomSampler,
            [Inject(Id = "Available Resources")] IEnumerable <IResourceDefinition> availableResources,
            IWeightedRandomSampler <IResourceDefinition> resourceRandomSampler
            )
        {
            NodeFactory = nodeFactory;
            ResourceRestrictionCanon = resourceRestrictionCanon;
            StrategicCopiesLogic     = strategicCopiesLogic;
            CellRandomSampler        = cellRandomSampler;
            ResourceRandomSampler    = resourceRandomSampler;

            StrategicResources = availableResources.Where(resource => resource.Type == ResourceType.Strategic);
        }