예제 #1
0
        public void TestMobileStam()
        {
            var m = new Mobile(0x1);

            m.DefaultMobileInit();

            var data = new MobileStam(m).Compile();

            Span <byte> expectedData = stackalloc byte[9];
            var         pos          = 0;

            expectedData.Write(ref pos, (byte)0xA3); // Packet ID
            expectedData.Write(ref pos, m.Serial);
            expectedData.WriteAttribute(ref pos, m.Stam, m.StamMax, false);

            AssertThat.Equal(data, expectedData);
        }
예제 #2
0
        public void TestMobileStam()
        {
            var m = new Mobile(0x1);

            m.DefaultMobileInit();
            m.Dex  = 75;
            m.Stam = 100;

            var expected = new MobileStam(m).Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendMobileStam(m);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }