private void GetData(MemoryMappedViewAccessor viewAccessor) { Attacks = new AttackData[MemoryAddresses.Attacks.Length]; viewAccessor.ReadArray(MemoryAddresses.Attacks.Address, Attacks, 0, MemoryAddresses.Attacks.Length); Castles = new CastleData[MemoryAddresses.Castles.Length]; viewAccessor.ReadArray(MemoryAddresses.Castles.Address, Castles, 0, MemoryAddresses.Castles.Length); DefaultKnights = new DefaultKnightData[MemoryAddresses.DefaultKnights.Length]; viewAccessor.ReadArray(MemoryAddresses.DefaultKnights.Address, DefaultKnights, 0, MemoryAddresses.DefaultKnights.Length); Classes = new ClassData[MemoryAddresses.Classes.Length]; viewAccessor.ReadArray(MemoryAddresses.Classes.Address, Classes, 0, MemoryAddresses.Classes.Length); Items = new ItemData[MemoryAddresses.Items.Length]; viewAccessor.ReadArray(MemoryAddresses.Items.Address, Items, 0, MemoryAddresses.Items.Length); SpecialAttacks = new SpecialAttackData[MemoryAddresses.SpecialAttacks.Length]; viewAccessor.ReadArray(MemoryAddresses.SpecialAttacks.Address, SpecialAttacks, 0, MemoryAddresses.SpecialAttacks.Length); Spells = new SpellData[MemoryAddresses.Spells.Length]; viewAccessor.ReadArray(MemoryAddresses.Spells.Address, Spells, 0, MemoryAddresses.Spells.Length); Skills = new SkillData[MemoryAddresses.Skills.Length]; viewAccessor.ReadArray(MemoryAddresses.Skills.Address, Skills, 0, MemoryAddresses.Skills.Length); #if WORK_IN_PROGRESS monstersInSummon = new MonsterInSummonData[MemoryAddresses.MonstersInSummon.Length]; viewAccessor.ReadArray(MemoryAddresses.MonstersInSummon.Address, monstersInSummon, 0, MemoryAddresses.MonstersInSummon.Length); statGrowth = new StatGrowthData[MemoryAddresses.StatGrowth.Length]; thisViewAccessor.ReadArray(MemoryAddresses.StatGrowth.Address, statGrowth, 0, MemoryAddresses.StatGrowth.Length); #endif }
public void CastFromUnsafeStructsTest() { CastleData firstCastleData = memoryAccessor.Castles[0]; Assert.AreEqual("Hervery", memoryAccessor.DereferenceString(firstCastleData.Name)); DefaultKnightData firstDefaultKnight = memoryAccessor.DefaultKnights[0]; Assert.AreEqual(1, firstDefaultKnight.Level); ClassData classData = memoryAccessor.Classes[0]; Assert.AreEqual("Fighter", memoryAccessor.DereferenceString(classData.Name)); SpecialAttackData firstSpecialAttackData = memoryAccessor.SpecialAttacks[0]; Assert.AreEqual("Howl Fire", memoryAccessor.DereferenceString(firstSpecialAttackData.Name)); SpellData firstSpellData = memoryAccessor.Spells[0]; Assert.AreEqual("Heal", memoryAccessor.DereferenceString(firstSpellData.Name)); }
public static int GetAddress(this DefaultKnightData test, int index) => MemoryAddresses.DefaultKnights.Address + (MemoryAddresses.DefaultKnights.SizeOf * index);
public DefaultKnightDataViewModel(ref DefaultKnightData data, MemoryAccessor memoryAccessor, int address) { Address = address; defaultKnightData = data; this.memoryAccessor = memoryAccessor; }