当前位置: 首页>>代码示例>>C#>>正文


C# Message.GetInteger方法代码示例

本文整理汇总了C#中Message.GetInteger方法的典型用法代码示例。如果您正苦于以下问题:C# Message.GetInteger方法的具体用法?C# Message.GetInteger怎么用?C# Message.GetInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message.GetInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CoinReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="CoinReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public CoinReceiveEvent(Message message)
     : base(message)
 {
     this.UserId = message.GetInteger(0);
     this.Coins = message.GetInteger(1);
     this.BlueCoins = message.GetInteger(2);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:11,代码来源:CoinReceiveEvent.cs

示例2: OnAddNoteblock

        /// <summary>
        /// Called when a note block is added.
        /// </summary>
        /// <param name="m">The message.</param>
        public void OnAddNoteblock(Message m)
        {
            // Extract data.
            int x = m.GetInteger(0),
                y = m.GetInteger(1),
                id = m.GetInteger(2),
                note = m.GetInteger(3);

            // Update relevant objects.
            Block b;

            switch (id)
            {
                case BlockIds.Action.Music.Percussion:
                    b = new PercussionBlock(x, y, note);
                    break;
                case BlockIds.Action.Music.Piano:
                    b = new PianoBlock(x, y, note);
                    break;
                default:
                    Tools.SkylightMessage("Error: noteblock does not exist");
                    return;
            }

            this._in.Source.Map[x, y, 0] = b;

            // Fire the event.
            var e = new BlockEventArgs(b, m, this._in.Source);

            this._in.Source.Pull.NoteBlock.SoundBlockEvent(e);
        }
开发者ID:KylerM,项目名称:Skylight,代码行数:35,代码来源:NoteBlock.cs

示例3: TeleportUserReceiveEvent

 public TeleportUserReceiveEvent(Message message)
     : base(message)
 {
     this.UserId = message.GetInteger(0);
     this.UserPosX = message.GetInteger(1);
     this.UserPosY = message.GetInteger(2);
 }
开发者ID:KylerM,项目名称:CupCake,代码行数:7,代码来源:TeleportUserReceiveEvent.cs

示例4: PotionReceiveEvent

 public PotionReceiveEvent(Message message)
     : base(message)
 {
     this.UserId = message.GetInteger(0);
     this.Potion = (Potion)message.GetInteger(1);
     this.Enabled = message.GetBoolean(2);
     this.Timeout = message.GetInteger(3);
 }
开发者ID:KylerM,项目名称:CupCake,代码行数:8,代码来源:PotionReceiveEvent.cs

示例5: WorldPortalPlaceReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public WorldPortalPlaceReceiveEvent(Message message)
     : base(message)
 {
     this.PosX = message.GetInteger(0);
     this.PosY = message.GetInteger(1);
     this.Block = (WorldPortalBlock)message.GetInteger(2);
     this.WorldPortalTarget = message.GetString(3);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:12,代码来源:WorldPortalPlaceReceiveEvent.cs

示例6: RotatablePlaceReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public RotatablePlaceReceiveEvent(Message message)
     : base(message)
 {
     this.PosX = message.GetInteger(0);
     this.PosY = message.GetInteger(1);
     this.Block = (RotatableBlock)message.GetInteger(2);
     this.Rotation = message.GetUInt(3);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:12,代码来源:RotatablePlaceReceiveEvent.cs

示例7: SignPlaceReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="SignPlaceReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public SignPlaceReceiveEvent(Message message)
     : base(message)
 {
     this.PosX = message.GetInteger(0);
     this.PosY = message.GetInteger(1);
     this.Block = (SignBlock)message.GetInteger(2);
     this.Text = message.GetString(3);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:12,代码来源:SignPlaceReceiveEvent.cs

示例8: SoundPlaceReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public SoundPlaceReceiveEvent(Message message)
     : base(message)
 {
     this.PosX = message.GetInteger(0);
     this.PosY = message.GetInteger(1);
     this.Block = (SoundBlock)message.GetInteger(2);
     this.SoundId = message.GetUInt(3);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:12,代码来源:SoundPlaceReceiveEvent.cs

示例9: LabelPlaceReceiveEvent

 public LabelPlaceReceiveEvent(Message message)
     : base(message)
 {
     this.PosX = message.GetInteger(0);
     this.PosY = message.GetInteger(1);
     this.Block = (LabelBlock)message.GetInteger(2);
     this.Text = message.GetString(3);
     this.TextColor = message.GetString(4);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:9,代码来源:LabelPlaceReceiveEvent.cs

示例10: UpdateMetaReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public UpdateMetaReceiveEvent(Message message)
     : base(message)
 {
     this.OwnerUsername = message.GetString(0);
     this.WorldName = message.GetString(1);
     this.Plays = message.GetInteger(2);
     this.CurrentWoots = message.GetInteger(3);
     this.TotalWoots = message.GetInteger(4);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:13,代码来源:UpdateMetaReceiveEvent.cs

示例11: OnLevelUp

        /// <summary>
        /// Called when a player levels up.
        /// </summary>
        /// <param name="m">
        /// The message.
        /// </param>
        public void OnLevelUp(Message m)
        {
            // Extract data.
            int id = m.GetInteger(0), level = m.GetInteger(1);

            // Update relevant objects.
            Player subject = Tools.GetPlayer(id, this._in.Source);
            subject.Level = level;

            // Fire the event.
            var e = new PlayerEventArgs(subject, this._in.Source, m);

            this._in.Source.Pull.LevelChange.LevelUpEvent(e);
        }
开发者ID:KylerM,项目名称:Skylight,代码行数:20,代码来源:LevelChange.cs

示例12: MoveReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="MoveReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public MoveReceiveEvent(Message message)
     : base(message)
 {
     this.UserId = message.GetInteger(0);
     this.UserPosX = message.GetInteger(1);
     this.UserPosY = message.GetInteger(2);
     this.SpeedX = message.GetDouble(3);
     this.SpeedY = message.GetDouble(4);
     this.ModifierX = message.GetDouble(5);
     this.ModifierY = message.GetDouble(6);
     this.Horizontal = message.GetDouble(7);
     this.Vertical = message.GetDouble(8);
     this.Coins = message.GetInteger(9);
     this.SpaceDown = message.GetBoolean(10);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:19,代码来源:MoveReceiveEvent.cs

示例13: OnCrown

        /// <summary>
        /// Called when a player gets the crown. Only one player can have the crown at one time.
        /// </summary>
        /// <param name="m">The message.</param>
        public void OnCrown(Message m)
        {
            // Extract data.
            int id = m.GetInteger(0);

            if (id == -1)
            {
                return;
            }

            // Update relevant objects.
            Player subject = Tools.GetPlayer(id, _in.Source);

            // Take the crown from the current holder (if one exists)
            Player crownHolder = Tools.GetCrownHolder(_in.Source);

            if (crownHolder != null)
                crownHolder.HasCrown = false;

            // Give it to the subject.
            if (subject != null)
                subject.HasCrown = true;

            // Fire the event.
            var e = new PlayerEventArgs(subject, _in.Source, m);

            _in.Source.Pull.Crown.CrownEvent(e);
        }
开发者ID:KylerM,项目名称:Skylight,代码行数:32,代码来源:Crown.cs

示例14: SayReceiveEvent

 /// <summary>
 ///     Initializes a new instance of the <see cref="ReceiveEvent" /> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public SayReceiveEvent(Message message)
     : base(message)
 {
     this.UserId = message.GetInteger(0);
     this.Text = message.GetString(1);
     this.IsMyFriend = message.GetBoolean(2);
 }
开发者ID:someone243,项目名称:CupCake,代码行数:11,代码来源:SayReceiveEvent.cs

示例15: OnTeleport

        /// <summary>
        /// Called when a player teleports to a location.
        /// </summary>
        /// <param name="m">
        /// The message.
        /// </param>
        public void OnTeleport(Message m)
        {
            // Extract data.
            int id = m.GetInteger(0), x = m.GetInteger(1), y = m.GetInteger(2);

            // Update relevant objects.
            Player subject = Tools.GetPlayer(id, this._in.Source);

            subject.X = x;
            subject.Y = y;

            // Fire the event.
            var e = new PlayerEventArgs(subject, this._in.Source, m);

            this._in.Source.Pull.Teleport.TeleportEvent(e);
        }
开发者ID:KylerM,项目名称:Skylight,代码行数:22,代码来源:Teleport.cs


注:本文中的Message.GetInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。