Ejemplo n.º 1
0
        public CommonItem(BaseResorcedRequirement[] craftingRequirements,
                          ItemMarket itemMarket,
                          CraftBuilding craftingBuilding,
                          int qualityLevel,
                          ITownManager buyTownManager,
                          ITownManager sellTownManager
                          )
        {
            QualityLevel         = qualityLevel;
            CraftingRequirements = craftingRequirements;

            IsArtefacted = CraftingRequirements.SelectMany(x => x.Resources)
                           .Any(r => r.Item.ShopCategory == ShopCategory.Artefacts || r.Item.ShopCategory == ShopCategory.Token);

            CraftingBuilding = craftingBuilding;
            ItemMarket       = itemMarket;

            _longBuyRequirement = new LongBuyRequirement(buyTownManager);
            _fastBuyRequirement = new FastBuyRequirement(buyTownManager);

            LongSellProfit   = new LongSellProfit(this, sellTownManager);
            FastSellProfit   = new FastSellProfit(this, sellTownManager);
            BmFastSellProfit = new BmFastSellProfit(this);
            BmLongSellProfit = new BmLongSellProfit(this);

            CostCalcOptions.Instance.Changed        += RequirementsOnUpdated;
            CostCalcOptions.Instance.ProfitsChanged += ProfitsOnUpdated;
        }
Ejemplo n.º 2
0
        protected BaseMarketProfit(CommonItem item, ITownManager townManager) : base(item)
        {
            townManager.TownChanged       += TownManagerOnTownChanged;
            GetMarketData().OrdersUpdated += OrdersUpdated;

            TownManagerOnTownChanged(townManager);
            OrdersUpdated(GetMarketData());
        }
Ejemplo n.º 3
0
 public XmlLoader(IBuildingDataManager buildingDataManager, ITownManager craftTownManager,
                  ITownManager buyTownManager, ITownManager sellTownManager)
 {
     _buyTownManager      = buyTownManager;
     _sellTownManager     = sellTownManager;
     _craftTownManager    = craftTownManager;
     _buildingDataManager = buildingDataManager;
 }
Ejemplo n.º 4
0
        public frmNewFamily(IHousingManager housingManager,
                            ICityManager cityManager,
                            ITownManager townManager,
                            INeighborhoodManager neighborhoodManager,
                            IFamilyManager familyManager)
        {
            _housingManager      = housingManager;
            _cityManager         = cityManager;
            _townManager         = townManager;
            _neighborhoodManager = neighborhoodManager;
            _familyManager       = familyManager;

            InitializeComponent();
        }
 public ExcelImportService(IPersonManager personManager,
                           IFamilyManager familyManager,
                           ITownManager townManager,
                           ICityManager cityManager,
                           INeighborhoodManager neighborhoodManager,
                           IEducationalStatusManager educationalStatusManager,
                           ISocialSecurityManager socialSecurityManager)
 {
     _personManager            = personManager;
     _familyManager            = familyManager;
     _cityManager              = cityManager;
     _townManager              = townManager;
     _neighborhoodManager      = neighborhoodManager;
     _educationalStatusManager = educationalStatusManager;
     _socialSecurityManager    = socialSecurityManager;
 }
        public frmAllFamily(ICityManager cityManager,
                            ITownManager townManager,
                            INeighborhoodManager neighborhoodManager,
                            IPersonManager personManager,
                            IFamilyManager familyManager)
        {
            _cityManager         = cityManager;
            _townManager         = townManager;
            _neighborhoodManager = neighborhoodManager;
            _personManager       = personManager;
            _familyManager       = familyManager;

            InitializeComponent();

            FillAllBase();
            FillCities();
        }
Ejemplo n.º 7
0
        public ProxyBuildingData(string id, BuildingDataManager manager, ITownManager crafTownManager)
        {
            _manager         = manager;
            _crafTownManager = crafTownManager;
            _buildingData    = new BuildingData(id);
            var data = manager.Rep.FindById(id);

            if (data != null)
            {
                var i = 0;
                foreach (var dataTaxData in data.TaxDatas)
                {
                    _buildingData.TaxDatas[i++] = dataTaxData;
                    if (i >= _buildingData.TaxDatas.Length)
                    {
                        break;
                    }
                }
            }
            _crafTownManager.TownChanged += ManagerOnTownChanged;
            UpdateTax += OnUpdateTax;
            ManagerOnTownChanged(crafTownManager);
        }
Ejemplo n.º 8
0
 private void CraftTownManagerOnTownChanged(ITownManager ctm)
 {
     Town = ctm.Town;
     ItemBuildingOnUpdateTax();
 }
Ejemplo n.º 9
0
 public CraftBuilding(ItemBuilding itemBuilding, ITownManager craftTownManager)
 {
     _itemBuilding                 = itemBuilding;
     _itemBuilding.UpdateTax      += ItemBuildingOnUpdateTax;
     craftTownManager.TownChanged += CraftTownManagerOnTownChanged;
 }
Ejemplo n.º 10
0
 private void BdmOnTownChanged(ITownManager tm)
 {
     RaisePropertyChanged(nameof(Buildings));
 }
Ejemplo n.º 11
0
 public BuildingsViewModel(Dictionary <string, CraftBuilding> loaderCraftBuildings, ITownManager townManager)
 {
     _loaderCraftBuildings    = loaderCraftBuildings;
     townManager.TownChanged += BdmOnTownChanged;
 }
Ejemplo n.º 12
0
 public BuildingDataManager(ITownManager townManager)
 {
     _townManager = townManager;
 }
Ejemplo n.º 13
0
 private void ManagerOnTownChanged(ITownManager townManager)
 {
     UpdateTax -= OnUpdateTax;
     Tax        = _buildingData.TaxDatas[_crafTownManager.TownId];
     UpdateTax += OnUpdateTax;
 }
Ejemplo n.º 14
0
 public FastBuyRequirement(ITownManager townManager) : base(townManager)
 {
 }
Ejemplo n.º 15
0
 public LongBuyRequirement(ITownManager townManager) : base(townManager)
 {
 }
Ejemplo n.º 16
0
 protected BaseMarketRequirement(ITownManager townManager)
 {
     _townManager = townManager;
 }
Ejemplo n.º 17
0
 public FastSellProfit(CommonItem item, ITownManager townManager) : base(item, townManager)
 {
 }