コード例 #1
0
ファイル: Construction.cs プロジェクト: ndech/Alpha
 public Construction(BuildingType type, Settlement location, Date today)
 {
     _type = type;
     _location = location;
     _startDate = today;
     //_resourceRequirements = _type.RequirementsFor(location);
 }
コード例 #2
0
ファイル: SettlementDetailPanel.cs プロジェクト: ndech/Alpha
 public void ShowSettlement(Settlement settlement)
 {
     if(settlement == null) return;
     Visible = true;
     _settlement = settlement;
     _name.Text = settlement.Name;
     _buildButton.Text = "Build "+ BuildingTypes.AvailableFor(_settlement).FirstOrDefault()?.Name ?? "No building";
     _resourceScrollableContainer.Refresh(settlement.Province.Resources.OrderByDescending(r=>r.Level.Value).ToList());
 }
コード例 #3
0
ファイル: BuildingTypes.cs プロジェクト: ndech/Alpha
 public static IEnumerable<BuildingType> AvailableFor(Settlement settlement)
 {
     Debug.Assert(_buildingTypes != null, "Building statuses not initialized");
     return
         _buildingTypes
             .Except(settlement.Buildings.Select(b => b.Type)) //Not already built
             .Where(type => (!type.ReplaceBuildings.Any() || type.ReplaceBuildings.Any(t=>settlement.Buildings.Select(b=>b.Type).Contains(t))))
             .Where(type => type.PreConditionsValidFor(settlement));
 }
コード例 #4
0
ファイル: LandProvince.cs プロジェクト: ndech/Alpha
 public LandProvince(World world, Zone zone) : base(world, zone)
 {
     Name = NameGenerator.GetRandomProvinceName();
     Color = CustomColor.Random;
     Capital = new Settlement(world, this);
 }
コード例 #5
0
ファイル: NewConstructionCommand.cs プロジェクト: ndech/Alpha
 public NewConstructionCommand(BuildingType buildingtype, Settlement settlement)
 {
     _buildingtype = buildingtype;
     _settlement = settlement;
 }
コード例 #6
0
 public LandProvince(World world, Zone zone) : base(world, zone)
 {
     Name    = NameGenerator.GetRandomProvinceName();
     Color   = CustomColor.Random;
     Capital = new Settlement(world, this);
 }
コード例 #7
0
ファイル: BuildingType.cs プロジェクト: ndech/Alpha
 public bool PreConditionsValidFor(Settlement settlement)
 {
     return _preConditions.All(p => p.IsValid(settlement));
 }
コード例 #8
0
ファイル: ConstructionStep.cs プロジェクト: ndech/Alpha
 internal int ManPowerRequirementsFor(Settlement location) => (int)_manpowerRequirement.For(location);
コード例 #9
0
ファイル: ConstructionStep.cs プロジェクト: ndech/Alpha
 internal List<ResourceRequirement> ResourceRequirementsFor(Settlement location)
 {
     return _resourceRequirements.Select(kvp => new ResourceRequirement(kvp.Key, (int)kvp.Value.For(location))).ToList();
 }