本文整理汇总了C#中Location.ToDoubleBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Location.ToDoubleBytes方法的具体用法?C# Location.ToDoubleBytes怎么用?C# Location.ToDoubleBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location.ToDoubleBytes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParticleEffectPacketOut
public ParticleEffectPacketOut(ParticleEffectNetType type, double dat1, Location pos)
{
UsageType = NetUsageType.EFFECTS;
ID = ServerToClientPacket.PARTICLE_EFFECT;
Data = new byte[1 + 4 + 24];
Data[0] = (byte)type;
Utilities.FloatToBytes((float)dat1).CopyTo(Data, 1);
pos.ToDoubleBytes().CopyTo(Data, 1 + 4);
}
示例2: DefaultSoundPacketOut
public DefaultSoundPacketOut(Location loc, DefaultSound sound, byte subdat)
{
UsageType = NetUsageType.EFFECTS;
ID = ServerToClientPacket.DEFAULT_SOUND;
Data = new byte[24 + 1 + 1];
loc.ToDoubleBytes().CopyTo(Data, 0);
Data[24] = (byte)sound;
Data[24 + 1] = subdat;
}
示例3: FlashLightPacketOut
public FlashLightPacketOut(PlayerEntity player, bool enabled, double distance, Location color)
{
UsageType = NetUsageType.PLAYERS;
ID = ServerToClientPacket.FLASHLIGHT;
Data = new byte[8 + 1 + 4 + 24];
Utilities.LongToBytes(player.EID).CopyTo(Data, 0);
Data[8] = (byte)(enabled ? 1 : 0);
Utilities.FloatToBytes((float)distance).CopyTo(Data, 8 + 1);
color.ToDoubleBytes().CopyTo(Data, 8 + 1 + 4);
}
示例4: PlaySoundPacketOut
public PlaySoundPacketOut(Server tserver, string sound, double vol, double pitch, Location pos)
{
UsageType = NetUsageType.EFFECTS;
ID = ServerToClientPacket.PLAY_SOUND;
Data = new byte[4 + 4 + 4 + 24];
Utilities.IntToBytes(tserver.Networking.Strings.IndexForString(sound)).CopyTo(Data, 0);
Utilities.FloatToBytes((float)vol).CopyTo(Data, 4);
Utilities.FloatToBytes((float)pitch).CopyTo(Data, 4 + 4);
pos.ToDoubleBytes().CopyTo(Data, 4 + 4 + 4);
}
示例5: YourPositionPacketOut
public YourPositionPacketOut(double delta, long tID, Location pos, Location vel, Location avel, Stance stance, bool pup)
{
UsageType = NetUsageType.PLAYERS;
ID = ServerToClientPacket.YOUR_POSITION;
Data = new byte[8 + 24 + 24 + 1 + 8];
Utilities.LongToBytes(tID).CopyTo(Data, 0);
pos.ToDoubleBytes().CopyTo(Data, 8);
vel.ToDoubleBytes().CopyTo(Data, 8 + 24);
Data[8 + 24 + 24] = (byte)((stance == Stance.Standing ? 0 : 1) | (pup ? 2: 0));
Utilities.DoubleToBytes(delta).CopyTo(Data, 8 + 24 + 24 + 1);
}
示例6: KeysPacketOut
public KeysPacketOut(long tID, KeysPacketData data, Location direction, float xmove, float ymove, Location pos, Location vel, float sow)
{
ID = ClientToServerPacket.KEYS;
Data = new byte[8 + 2 + 4 + 4 + 4 + 4 + 24 + 24 + 4];
Utilities.LongToBytes(tID).CopyTo(Data, 0);
Utilities.UshortToBytes((ushort)data).CopyTo(Data, 8);
Utilities.FloatToBytes((float)direction.Yaw).CopyTo(Data, 8 + 2);
Utilities.FloatToBytes((float)direction.Pitch).CopyTo(Data, 8 + 2 + 4);
Utilities.FloatToBytes(xmove).CopyTo(Data, 8 + 2 + 4 + 4);
Utilities.FloatToBytes(ymove).CopyTo(Data, 8 + 2 + 4 + 4 + 4);
int s = 8 + 2 + 4 + 4 + 4 + 4;
pos.ToDoubleBytes().CopyTo(Data, s);
vel.ToDoubleBytes().CopyTo(Data, s + 24);
Utilities.FloatToBytes(sow).CopyTo(Data, s + 24 + 24);
}
示例7: TeleportPacketOut
public TeleportPacketOut(Location pos)
{
UsageType = NetUsageType.PLAYERS;
ID = ServerToClientPacket.TELEPORT;
Data = pos.ToDoubleBytes();
}