コード例 #1
0
 public GameController(Memory memory)
 {
     Memory            = memory;
     Area              = new AreaController(this);
     EntityListWrapper = new EntityListWrapper(this);
     Window            = new GameWindow(memory.Process);
     Game              = new TheGame(memory);
     Files             = new FsController(memory);
 }
コード例 #2
0
ファイル: GameController.cs プロジェクト: asd34278/PoeHud
 public GameController(Memory memory)
 {
     Memory = memory;
     Area = new AreaController(this);
     EntityListWrapper = new EntityListWrapper(this);
     Window = new GameWindow(memory.Process);
     Game = new TheGame(memory);
     Files = new FsController(memory);
 }
コード例 #3
0
ファイル: ModValue.cs プロジェクト: TomTer/PoeHud
        public ModValue(ItemMod mod, FsController fs, int iLvl)
        {
            string name = mod.RawName;
            Record = fs.Mods.records[name];
            AffixType = Record.AffixType;
            AffixText = String.IsNullOrEmpty(Record.UserFriendlyName) ? Record.Key : Record.UserFriendlyName;
            IsCrafted = Record.Domain == 10;
            StatValue = new[] { mod.Value1, mod.Value2, mod.Value3, mod.Value4 };
            Tier = -1;

            int subOptimalTierDistance = 0;

            List<ModsDat.ModRecord> allTiers;
            if (fs.Mods.recordsByTier.TryGetValue(Tuple.Create(Record.Group, Record.AffixType), out allTiers))
            {
                IEnumerable<string> validTags = Record.Tags.Select(t => t.Key)
                    .Where((t, tIdx) => Record.TagChances
                    .Where((c, cIdx) => tIdx == cIdx && c > 0).Any());
                bool tierFound = false;
                totalTiers = 0;
                foreach (ModsDat.ModRecord record in allTiers)
                {
                    // skip tiers that cannot be attained normally
                    if (!record.Tags.Where((t, tIdx) => record.TagChances
                        .Where((c, cIdx) => tIdx == cIdx && c > 0 && (t.Key == "default" || validTags.Contains(t.Key)))
                        .Any()).Any())
                    {
                        continue;
                    }
                    if (record.StatNames[0] == Record.StatNames[0] && record.StatNames[1] == Record.StatNames[1]
                        && record.StatNames[2] == Record.StatNames[2] && record.StatNames[3] == Record.StatNames[3])
                    {
                        totalTiers++;
                        if (record.Equals(Record))
                        {
                            Tier = totalTiers;
                            tierFound = true;
                        }
                        if (!tierFound && record.MinLevel <= iLvl)
                        {
                            subOptimalTierDistance++;
                        }
                    }
                }
            }

            double hue = totalTiers == 1 ? 180 : 120 - Math.Min(subOptimalTierDistance, 3) * 40;
            Color = ColorUtils.ColorFromHsv(hue, totalTiers == 1 ? 0 : 1, 1);
        }
コード例 #4
0
        public GameController(Memory memory)
        {
            Instance                = this;
            Memory                  = memory;
            Game                    = new TheGame(memory);
            GameStateController     = new GameStateController(memory, Game);
            CoroutineRunner         = new Runner("Main Coroutine");
            CoroutineRunnerParallel = new Runner("Parallel Coroutine");
            Area                    = new AreaController(this);
            EntityListWrapper       = new EntityListWrapper(this);
            Window                  = new GameWindow(memory.Process);
            Cache                   = new Cache();

            Files             = new FsController(memory);
            StashController   = new StashTabController();
            InGame            = InGameReal;
            IsForeGroundCache = WinApi.IsForegroundWindow(Window.Process.MainWindowHandle);
            MainTimer         = Stopwatch.StartNew();
        }