public PlayerEntity(ObjectGUID objectGUID, character databaseCharacter, WorldSession session) : base(objectGUID) { this.Character = databaseCharacter; this.Session = session; this.SpellCollection = new SpellCollection(this); this.ActionButtonCollection = new ActionButtonCollection(this); }
public PSActionButtons(ActionButtonCollection collection) : base(WorldOpcodes.SMSG_ACTION_BUTTONS) { var savedButtons = collection.ToList(); for (int button = 0; button < 120; button++) { int index = savedButtons.FindIndex(b => b.button == button); character_action currentButton = index != -1 ? savedButtons[index] : null; if (currentButton != null) { uint packedData = (uint)currentButton.action | (uint)currentButton.type << 24; this.Write(packedData); } else { this.Write((uint)0); } } }