public void TestMobileAnimation() { Serial mobile = 0x1; var action = 200; var frameCount = 5; var repeatCount = 1; var reverse = false; var repeat = false; byte delay = 5; var data = new MobileAnimation( mobile, action, frameCount, repeatCount, !reverse, repeat, delay ).Compile(); Span <byte> expectedData = stackalloc byte[14]; var pos = 0; expectedData.Write(ref pos, (byte)0x6E); expectedData.Write(ref pos, mobile); expectedData.Write(ref pos, (ushort)action); expectedData.Write(ref pos, (ushort)frameCount); expectedData.Write(ref pos, (ushort)repeatCount); expectedData.Write(ref pos, reverse); expectedData.Write(ref pos, repeat); expectedData.Write(ref pos, delay); AssertThat.Equal(data, expectedData); }
// ============================================================================================================ // Ctor, Dispose, Update, and CreateView() // ============================================================================================================ public Mobile(Serial serial, Map map) : base(serial, map) { Animation = new MobileAnimation(this); Equipment = new MobileEquipment(this); _movement = new MobileMovement(this); _movement.RequiresUpdate = true; Health = new CurrentMaxValue(); Stamina = new CurrentMaxValue(); Mana = new CurrentMaxValue(); Followers = new CurrentMaxValue(); Weight = new CurrentMaxValue(); Flags = new MobileFlags(); }
// ============================================================ // Ctor, Dispose, Update, and CreateView() // ============================================================ public Mobile(Serial serial, Map map) : base(serial, map) { Animation = new MobileAnimation(this); Equipment = new MobileEquipment(this); m_movement = new MobileMovement(this); m_movement.RequiresUpdate = true; Health = new CurrentMaxValue(); Stamina = new CurrentMaxValue(); Mana = new CurrentMaxValue(); Followers = new CurrentMaxValue(); Weight = new CurrentMaxValue(); Flags = new MobileFlags(); }