Exemplo n.º 1
0
        public MainWindow(
            CefBrowserHandler browser,
            IDatabaseItemDao databaseItemDao,
            IDatabaseItemStatDao databaseItemStatDao,
            IPlayerItemDao playerItemDao,
            IDatabaseSettingDao databaseSettingDao,
            IBuddyItemDao buddyItemDao,
            IBuddySubscriptionDao buddySubscriptionDao,
            ArzParser arzParser,
            IRecipeItemDao recipeItemDao,
            IItemSkillDao itemSkillDao
            )
        {
            _cefBrowserHandler = browser;
            InitializeComponent();
            FormClosing += MainWindow_FormClosing;
            Instance     = this;

            _reportUsageStatistics = new Stopwatch();
            _reportUsageStatistics.Start();

            _dynamicPacker        = new DynamicPacker(databaseItemStatDao);
            _databaseItemDao      = databaseItemDao;
            _databaseItemStatDao  = databaseItemStatDao;
            _playerItemDao        = playerItemDao;
            _databaseSettingDao   = databaseSettingDao;
            _buddyItemDao         = buddyItemDao;
            _buddySubscriptionDao = buddySubscriptionDao;
            _arzParser            = arzParser;
            _recipeParser         = new RecipeParser(recipeItemDao);
            _itemSkillDao         = itemSkillDao;
        }
Exemplo n.º 2
0
        public StashManager(
            IPlayerItemDao playerItemDao,
            IDatabaseItemStatDao dbItemStatDao,
            Action <string, string> setFeedback,
            Action performedLootCallback
            )
        {
            _playerItemDao         = playerItemDao;
            _itemSizeService       = new ItemSizeService(dbItemStatDao);
            _setFeedback           = setFeedback;
            _performedLootCallback = performedLootCallback;

            var path = GlobalPaths.SavePath;

            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                UpdateUnlooted(path);

                var pCrypto = new GDCryptoDataBuffer(DataBuffer.ReadBytesFromDisk(path));
                var stash   = new Stash();

                if (stash.Read(pCrypto))
                {
                    NumStashTabs = stash.Tabs.Count;
                }
            }
        }
Exemplo n.º 3
0
 public PlayerItemDaoImpl(
     ISessionCreator sessionCreator,
     IDatabaseItemStatDao databaseItemStatDao,
     SqlDialect dialect) : base(sessionCreator, dialect)
 {
     _databaseItemStatDao = databaseItemStatDao;
 }
Exemplo n.º 4
0
        public TransferStashService(
            IPlayerItemDao playerItemDao,
            IDatabaseItemStatDao dbItemStatDao,
            Action <string, string, string> setFeedback,
            Action performedLootCallback
            )
        {
            _playerItemDao         = playerItemDao;
            _itemSizeService       = new ItemSizeService(dbItemStatDao);
            _setFeedback           = setFeedback;
            _performedLootCallback = performedLootCallback;

            // TODO: Should also check for transfer.gsh and pick whichever is newest / has the highest number
            var path = Path.Combine(GlobalPaths.SavePath, "transfer.gst");

            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                UpdateUnlooted(path);

                var pCrypto = new GDCryptoDataBuffer(DataBuffer.ReadBytesFromDisk(path));
                var stash   = new Stash();

                if (stash.Read(pCrypto))
                {
                    NumStashTabs = stash.Tabs.Count;
                }
            }
        }
Exemplo n.º 5
0
 public ItemStatService(
     IDatabaseItemStatDao databaseItemStatDao,
     IItemSkillDao itemSkillDao
     )
 {
     this._databaseItemStatDao = databaseItemStatDao;
     this._itemSkillDao        = itemSkillDao;
     _xpacSkills = _databaseItemStatDao.GetExpacSkillModifierSkills();
 }
Exemplo n.º 6
0
 public ItemStatService(
     IDatabaseItemStatDao databaseItemStatDao,
     IItemSkillDao itemSkillDao,
     SettingsService settings)
 {
     this._databaseItemStatDao = databaseItemStatDao;
     this._itemSkillDao        = itemSkillDao;
     _settings = settings;
 }
Exemplo n.º 7
0
        public TransferStashService(IDatabaseItemStatDao dbItemStatDao, SettingsService settings, SafeTransferStashWriter stashWriter)
        {
            _settings        = settings;
            _stashWriter     = stashWriter;
            _itemSizeService = new ItemSizeService(dbItemStatDao);

            // This is used to limit settings, just pick whichever is highest.
            NumStashTabs = Math.Max(
                GetNumTabsInStash(Path.Combine(GlobalPaths.SavePath, "transfer.gst")),
                GetNumTabsInStash(Path.Combine(GlobalPaths.SavePath, "transfer.gsh"))
                );
        }
Exemplo n.º 8
0
 public ArzParser(
     IDatabaseItemDao databaseItemDao,
     IDatabaseItemStatDao databaseItemStatDao,
     IDatabaseSettingDao databaseSettingDao,
     IItemSkillDao itemSkillDao
     )
 {
     _databaseItemDao     = databaseItemDao;
     _databaseItemStatDao = databaseItemStatDao;
     _databaseSettingDao  = databaseSettingDao;
     _itemSkillDao        = itemSkillDao;
 }
Exemplo n.º 9
0
        public SearchController(
            IDatabaseItemDao databaseItemDao,
            IPlayerItemDao playerItemDao,
            IDatabaseItemStatDao databaseItemStatDao,
            IItemSkillDao itemSkillDao,
            IBuddyItemDao buddyItemDao
            //StashManager stashManager
            )
        {
            this._dbItemDao            = databaseItemDao;
            this._playerItemDao        = playerItemDao;
            this._itemStatService      = new ItemStatService(databaseItemStatDao, itemSkillDao);
            this._itemPaginatorService = new ItemPaginatorService(TakeSize);
            this._recipeService        = new RecipeService(databaseItemDao);
            //this._costCalculationService = new CostCalculationService(playerItemDao, stashManager);
            this._buddyItemDao = buddyItemDao
                                 //this._stashManager = stashManager
            ;


            // Just make sure it writes .css/.html files before displaying anything to the browser
            //
            ItemHtmlWriter.ToJsonSerializeable(new List <PlayerHeldItem>()); // TODO: is this not a NOOP?
            JsBind.OnRequestItems += JsBind_OnRequestItems;

            // Return the ingredients for a given recipe
            JsBind.OnRequestRecipeIngredients += (sender, args) => {
                var recipeArgument = args as RequestRecipeArgument;
                var ingredients    = _recipeService.GetRecipeIngredients(recipeArgument?.RecipeRecord);
                //_costCalculationService.Populate(ingredients);
                //_costCalculationService.SetMod(_previousMod);

                _previousCallback = recipeArgument?.Callback;
                _previousRecipe   = recipeArgument?.RecipeRecord;
                Browser.JsCallback(recipeArgument?.Callback, JsBind.Serialize(ingredients));
            };


            // Update the recipe when the stash has changed
            //stashManager.StashUpdated += StashManagerOnStashUpdated;


            // Return the list of recipes
            JsBind.OnRequestRecipeList += (sender, args) => {
                var recipeArgument = args as RequestRecipeArgument;
                var recipes        = _recipeService.GetRecipeList();
                Browser.JsCallback(recipeArgument?.Callback, JsBind.Serialize(recipes));
            };
        }
Exemplo n.º 10
0
        public ItemStatService(
            IDatabaseItemStatDao databaseItemStatDao,
            IItemSkillDao itemSkillDao,
            SettingsService settings)
        {
            this._databaseItemStatDao = databaseItemStatDao;
            this._itemSkillDao        = itemSkillDao;
            _settings = settings;

            Thread thread = new Thread(() => {
                ExceptionReporter.EnableLogUnhandledOnThread();
                _xpacSkills = _databaseItemStatDao.GetExpacSkillModifierSkills();
            });

            thread.Start();
        }
Exemplo n.º 11
0
 public ParsingService(
     IItemTagDao itemTagDao,
     string grimdawnLocation,
     IDatabaseItemDao databaseItemDao,
     IDatabaseItemStatDao databaseItemStatDao,
     IItemSkillDao itemSkillDao,
     string localizationFile
     )
 {
     _itemTagDao          = itemTagDao;
     _grimdawnLocation    = grimdawnLocation;
     _databaseItemDao     = databaseItemDao;
     _databaseItemStatDao = databaseItemStatDao;
     _itemSkillDao        = itemSkillDao;
     _localizationFile    = localizationFile;
 }
Exemplo n.º 12
0
        public StashManager(IPlayerItemDao playerItemDao, IDatabaseItemStatDao dbItemStatDao)
        {
            _playerItemDao   = playerItemDao;
            _itemSizeService = new ItemSizeService(dbItemStatDao);
            string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "My Games",
                                       "Grim Dawn", "Save", "transfer.gst");

            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                UpdateUnlooted(path);

                GDCryptoDataBuffer pCrypto = new GDCryptoDataBuffer(DataBuffer.ReadBytesFromDisk(path));
                Stash stash = new Stash();
                if (stash.Read(pCrypto))
                {
                    NumStashTabs = stash.Tabs.Count;
                }
            }
        }
Exemplo n.º 13
0
 public MainWindow(
     CefBrowserHandler browser,
     IDatabaseItemDao databaseItemDao,
     IDatabaseItemStatDao databaseItemStatDao,
     IPlayerItemDao playerItemDao,
     IAzurePartitionDao azurePartitionDao,
     IDatabaseSettingDao databaseSettingDao,
     IBuddyItemDao buddyItemDao,
     IBuddySubscriptionDao buddySubscriptionDao,
     IRecipeItemDao recipeItemDao,
     IItemSkillDao itemSkillDao,
     IItemTagDao itemTagDao,
     ParsingService parsingService,
     AugmentationItemRepo augmentationItemRepo,
     SettingsService settingsService,
     GrimDawnDetector grimDawnDetector,
     IItemCollectionDao itemCollectionRepo
     )
 {
     _cefBrowserHandler = browser;
     InitializeComponent();
     FormClosing            += MainWindow_FormClosing;
     _automaticUpdateChecker = new AutomaticUpdateChecker(settingsService);
     _settingsController     = new SettingsController(settingsService);
     _dynamicPacker          = new DynamicPacker(databaseItemStatDao);
     _databaseItemDao        = databaseItemDao;
     _databaseItemStatDao    = databaseItemStatDao;
     _playerItemDao          = playerItemDao;
     _azurePartitionDao      = azurePartitionDao;
     _databaseSettingDao     = databaseSettingDao;
     _buddyItemDao           = buddyItemDao;
     _buddySubscriptionDao   = buddySubscriptionDao;
     _recipeParser           = new RecipeParser(recipeItemDao);
     _itemSkillDao           = itemSkillDao;
     _itemTagDao             = itemTagDao;
     _parsingService         = parsingService;
     _augmentationItemRepo   = augmentationItemRepo;
     _userFeedbackService    = new UserFeedbackService(_cefBrowserHandler);
     _settingsService        = settingsService;
     _grimDawnDetector       = grimDawnDetector;
     _itemCollectionRepo     = itemCollectionRepo;
 }
Exemplo n.º 14
0
        public TransferStashService(IDatabaseItemStatDao dbItemStatDao, SettingsService settings, SafeTransferStashWriter stashWriter)
        {
            _settings        = settings;
            _stashWriter     = stashWriter;
            _itemSizeService = new ItemSizeService(dbItemStatDao);

            // TODO: Should also check for transfer.gsh and pick whichever is newest / has the highest number
            var path = Path.Combine(GlobalPaths.SavePath, "transfer.gst");

            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                var pCrypto = new GDCryptoDataBuffer(DataBuffer.ReadBytesFromDisk(path));
                var stash   = new Stash();

                if (stash.Read(pCrypto))
                {
                    NumStashTabs = stash.Tabs.Count;
                }
            }
        }
Exemplo n.º 15
0
        public MainWindow(
            CefBrowserHandler browser,
            IDatabaseItemDao databaseItemDao,
            IDatabaseItemStatDao databaseItemStatDao,
            IPlayerItemDao playerItemDao,
            IAzurePartitionDao azurePartitionDao,
            IDatabaseSettingDao databaseSettingDao,
            IBuddyItemDao buddyItemDao,
            IBuddySubscriptionDao buddySubscriptionDao,
            ArzParser arzParser,
            IRecipeItemDao recipeItemDao,
            IItemSkillDao itemSkillDao,
            IItemTagDao itemTagDao,
            ParsingService parsingService,
            bool requestedDevtools,
            AugmentationItemRepo augmentationItemRepo
            )
        {
            _cefBrowserHandler = browser;
            InitializeComponent();
            FormClosing += MainWindow_FormClosing;

            _reportUsageStatistics = new Stopwatch();
            _reportUsageStatistics.Start();

            _dynamicPacker          = new DynamicPacker(databaseItemStatDao);
            _databaseItemDao        = databaseItemDao;
            _databaseItemStatDao    = databaseItemStatDao;
            _playerItemDao          = playerItemDao;
            _azurePartitionDao      = azurePartitionDao;
            _databaseSettingDao     = databaseSettingDao;
            _buddyItemDao           = buddyItemDao;
            _buddySubscriptionDao   = buddySubscriptionDao;
            _arzParser              = arzParser;
            _recipeParser           = new RecipeParser(recipeItemDao);
            _itemSkillDao           = itemSkillDao;
            _itemTagDao             = itemTagDao;
            _parsingService         = parsingService;
            this._requestedDevtools = requestedDevtools;
            _augmentationItemRepo   = augmentationItemRepo;
        }
Exemplo n.º 16
0
        public SearchController(
            IDatabaseItemDao databaseItemDao,
            IPlayerItemDao playerItemDao,
            IDatabaseItemStatDao databaseItemStatDao,
            IItemSkillDao itemSkillDao,
            IBuddyItemDao buddyItemDao,
            AugmentationItemRepo augmentationItemRepo, SettingsService settings)
        {
            _dbItemDao            = databaseItemDao;
            _playerItemDao        = playerItemDao;
            _itemStatService      = new ItemStatService(databaseItemStatDao, itemSkillDao, settings);
            _itemPaginatorService = new ItemPaginatorService(TakeSize);
            _buddyItemDao         = buddyItemDao;
            _augmentationItemRepo = augmentationItemRepo;
            _settings             = settings;

            // Just make sure it writes .css/.html files before displaying anything to the browser
            //
            ItemHtmlWriter.ToJsonSerializeable(new List <PlayerHeldItem>()); // TODO: is this not a NOOP?
            JsBind.OnRequestItems += JsBind_OnRequestItems;
        }
Exemplo n.º 17
0
 public DatabaseItemStatRepo(ThreadExecuter threadExecuter, ISessionCreator sessionCreator) : base(threadExecuter, sessionCreator)
 {
     this.repo     = new DatabaseItemStatDaoImpl(sessionCreator);
     this.BaseRepo = repo;
 }
Exemplo n.º 18
0
 public PlayerItemDaoImpl(ISessionCreator sessionCreator, IDatabaseItemStatDao databaseItemStatDao) : base(sessionCreator)
 {
     _databaseItemStatDao = databaseItemStatDao;
 }
Exemplo n.º 19
0
 public AugmentationItemDaoImpl(ISessionCreator sessionCreator, IDatabaseItemStatDao databaseItemStatDao) : base(sessionCreator)
 {
     _databaseItemStatDao = databaseItemStatDao;
 }
Exemplo n.º 20
0
 public DynamicPacker(IDatabaseItemStatDao itemStatDao)
 {
     this._itemStatDao = itemStatDao;
 }
Exemplo n.º 21
0
 public ItemSizeService(IDatabaseItemStatDao databaseItemStatDao)
 {
     this.dao = databaseItemStatDao;
 }
Exemplo n.º 22
0
 public AugmentationItemRepo(ThreadExecuter threadExecuter, ISessionCreator sessionCreator, IDatabaseItemStatDao databaseItemStatDao) : base(threadExecuter, sessionCreator)
 {
     _repo         = new AugmentationItemDaoImpl(sessionCreator, databaseItemStatDao);
     this.BaseRepo = _repo;
 }