عرض مشاركة واحدة
قديم 2020-02-19, 10:34 AM
المشاركة 12
megokarika
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة فى الجليد سورس rayz v3
بوص يصطي اعمل سرش علي

Class BitConverter

بعد لما هتلاقيها هتعمل

Ctrl-A

وهتمسح الكلاس كلو وتضيف دا

كود:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 
Rayzo
{
    public 
unsafe class BitConverter
    
{



        public static 
ulong ToUInt64(byte[] bufferint offset)
        {
            if (
offset buffer.Length 8) return 0;
            
fixed (byteBuffer buffer)
            {
                return *((
ulong*)(Buffer offset));
            }
        }
        public static 
Boolean ToBoolean(byte[] bufferint offset)
        {
            if (
offset buffer.Length 4) return false;
            
fixed (byteBuffer buffer)
            {
                return *((
Boolean*)(Buffer offset));
            }
        }
        public static 
uint ToUInt32(byte[] bufferint offset)
        {
            if (
offset buffer.Length 4) return 0;
            
fixed (byteBuffer buffer)
            {
                return *((
uint*)(Buffer offset));
            }
        }
        public static 
int ToInt32(byte[] bufferint offset)
        {
            if (
offset buffer.Length 4) return 0;
            
fixed (byteBuffer buffer)
            {
                return *((
int*)(Buffer offset));
            }
        }
        public static 
ushort ToUInt16(byte[] bufferint offset)
        {
            if (
offset buffer.Length 2) return 0;
            
fixed (byteBuffer buffer)
            {
                return *((
ushort*)(Buffer offset));
            }
        }
        public static 
short ToInt16(byte[] bufferint offset)
        {
            if (
offset buffer.Length 2) return 0;
            
fixed (byteBuffer buffer)
            {
                return *((
short*)(Buffer offset));
            }
        }

        public static 
ulong ReadUlong(byte[] bufferint offset)
        {
            
fixed (byteBuffer buffer)
            {
                return *((
ulong*)(Buffer offset));
            }
        }
        public static 
uint ReadUint(byte[] bufferint offset)
        {
            
fixed (byteBuffer buffer)
            {
                return *((
uint*)(Buffer offset));
            }
        }
        public static 
ushort ReadUshort(byte[] bufferint offset)
        {
            
fixed (byteBuffer buffer)
            {
                return *((
ushort*)(Buffer offset));
            }
        }
    }




جارى خليك معايا