コード例 #1
0
ファイル: DataContext.cs プロジェクト: cualquiercosa327/DQ7
        public DataContext()
        {
            for (uint i = 0; i < 6; i++)
            {
                Charactors.Add(new Charactor(0x0C80 + i * 0x01EC));
            }

            BagItem item = null;

            for (uint i = Util.BagItemCount - 1; (int)i >= 0; i--)
            {
                item = new BagItem(0x0544 + i * 2, 0x09D4 + i, item);
                item.PropertyChanged += Item_PropertyChanged;
                Bag.Insert(0, item);
            }

            foreach (var place in Info.Instance().Places)
            {
                Places.Add(new Place(place.Value)
                {
                    Name = place.Name
                });
            }

            foreach (var monster in Info.Instance().Monsters)
            {
                if (monster.ID != 0)
                {
                    Monsters.Add(new MonsterBook(0x1854 + (monster.ID - 1) * 8)
                    {
                        Name = monster.Name
                    });
                }
                if (monster.Passing)
                {
                    PassingSlateMonsters.Add(monster);
                }
                if (monster.Stamp)
                {
                    StampMonsters.Add(monster);
                }
            }

            for (uint i = 0; i < Util.MonsterStampCount; i++)
            {
                MonsterStamps.Add(new MonsterStamp(0x2E06 + i * 2));
            }

            foreach (var place in Info.Instance().ParkPlaces)
            {
                MonsterParkPlaces.Add(new MonsterParkPlace(0x00AC, place.Value)
                {
                    Name = place.Name
                });
            }

            for (uint i = 0; i < Util.MonsterParkDormitoryCount; i++)
            {
                MonsterParkDormitorys.Add(new MonsterParkDormitory(0x04BC + i * 4, 0x3180 + i));
            }

            for (uint i = 0; i < Util.PartyMemberCount; i++)
            {
                Party.Add(new PartyMember(0x0510 + i * 4));
            }

            for (uint i = 0; i < Util.PassingSlateCount; i++)
            {
                uint address = 0x32D0 + i * 44;
                if (SaveData.Instance().ReadNumber(address, 1) == 0)
                {
                    break;
                }
                PassingSlates.Add(new PassingSlate(address));
            }

            foreach (var monster in Info.Instance().TownMonsters)
            {
                TownMonsters.Add(new TownMonster(0x01E9, monster.Value)
                {
                    Name = monster.Name
                });
            }
        }