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


C# Location.ToDoubleBytes方法代码示例

本文整理汇总了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);
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:9,代码来源:ParticleEffectPacketOut.cs

示例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;
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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);
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例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);
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:10,代码来源:PlaySoundPacketOut.cs

示例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);
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:11,代码来源:YourPositionPacketOut.cs

示例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);
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:15,代码来源:KeysPacketOut.cs

示例7: TeleportPacketOut

 public TeleportPacketOut(Location pos)
 {
     UsageType = NetUsageType.PLAYERS;
     ID = ServerToClientPacket.TELEPORT;
     Data = pos.ToDoubleBytes();
 }
开发者ID:,项目名称:,代码行数:6,代码来源:


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