コード例 #1
0
ファイル: PlayerEntity.cs プロジェクト: stolborez/Vanilla
 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);
 }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
ファイル: PSActionButtons.cs プロジェクト: Refuge89/Vanilla
        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);
                }
            }
        }