本文整理汇总了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);
}
示例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);
}
示例3: TeleportUserReceiveEvent
public TeleportUserReceiveEvent(Message message)
: base(message)
{
this.UserId = message.GetInteger(0);
this.UserPosX = message.GetInteger(1);
this.UserPosY = message.GetInteger(2);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}