コード例 #1
0
 public Coordinate2d()
 {
     m_Compressor = new RailFloatCompressor(
         0.0f,
         Math.Max(Campaign.MapWidth, Campaign.MapHeight),
         Compare.COORDINATE_PRECISION / 10.0f);
 }
コード例 #2
0
 public static float PeekFloat(
   this RailBitBuffer buffer,
   RailFloatCompressor compressor)
 {
   if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     return compressor.Unpack(buffer.PeekUInt());
   else
     return compressor.Unpack(buffer.Peek(compressor.RequiredBits));
 }
コード例 #3
0
 public static void WriteFloat(
   this RailBitBuffer buffer, 
   RailFloatCompressor compressor, 
   float value)
 {
   if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     buffer.WriteUInt(compressor.Pack(value));
   else
     buffer.Write(compressor.RequiredBits, compressor.Pack(value));
 }
コード例 #4
0
 public static float PeekFloat(
     this RailBitBuffer buffer,
     RailFloatCompressor compressor)
 {
     if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     {
         return(compressor.Unpack(buffer.PeekUInt()));
     }
     else
     {
         return(compressor.Unpack(buffer.Peek(compressor.RequiredBits)));
     }
 }
コード例 #5
0
 public static void WriteFloat(
     this RailBitBuffer buffer,
     RailFloatCompressor compressor,
     float value)
 {
     if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     {
         buffer.WriteUInt(compressor.Pack(value));
     }
     else
     {
         buffer.Write(compressor.RequiredBits, compressor.Pack(value));
     }
 }