本文整理汇总了C#中CWrapped.Wrapped.readShort方法的典型用法代码示例。如果您正苦于以下问题:C# Wrapped.readShort方法的具体用法?C# Wrapped.readShort怎么用?C# Wrapped.readShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWrapped.Wrapped
的用法示例。
在下文中一共展示了Wrapped.readShort方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadEntityMetadata
public static object[] ReadEntityMetadata(Wrapped wSock) {
var MetadataDict = new Dictionary<int, object>();
do {
var item = wSock.readByte();
if (item == 127)
break;
var index = item & 0x1F;
var type = item >> 5;
switch (type) {
case 0:
MetadataDict.Add(index, wSock.readByte());
break;
case 1:
MetadataDict.Add(index, wSock.readShort());
break;
case 2:
MetadataDict.Add(index, wSock.readInt());
break;
case 3:
MetadataDict.Add(index, wSock.readFloat());
break;
case 4:
MetadataDict.Add(index, wSock.readString());
break;
case 5:
MetadataDict.Add(index, ReadSlot(wSock));
break;
case 6:
MetadataDict.Add(index, new Vector(wSock.readInt(), wSock.readInt(), wSock.readInt()));
break;
}
} while (true);
MetadataDict.OrderBy(o => o.Key); // -- Order the dictionary based on the index values
return MetadataDict.Values.ToArray(); // -- Return the data as an array.
}
示例2: Read
public void Read(Wrapped wSock) {
Experiencebar = wSock.readFloat();
Level = wSock.readShort();
TotalExperience = wSock.readShort();
}
示例3: ReadPropertyData
public static PropertyData ReadPropertyData(Wrapped wSock) {
var Data = new PropertyData();
Data.Key = wSock.readString();
Data.Value = wSock.readDouble();
Data.ListLength = wSock.readShort();
Data.Modifiers = new ModifierData[Data.ListLength];
for (int x = 0; x < Data.ListLength; x++)
Data.Modifiers[x] = ReadModifierData(wSock);
return Data;
}
示例4: ReadSlot
public static SlotData ReadSlot(Wrapped wSock) {
var Data = new SlotData();
Data.ID = wSock.readShort();
if (Data.ID == -1) {
Data.ID = 0;
Data.ItemCount = 0;
Data.ItemDamage = 0;
return Data;
}
Data.ItemCount = wSock.readByte();
Data.ItemDamage = wSock.readShort();
var NBTLength = wSock.readShort();
if (NBTLength == -1)
return Data;
Data.NbtData = wSock.readByteArray(NBTLength);
return Data;
}
示例5: ReadObjectMetadata
public static ObjectMetadata ReadObjectMetadata(Wrapped wSock) {
var Data = new ObjectMetadata();
Data.ObjectID = wSock.readInt();
if (Data.ObjectID != 0) {
Data.SpeedX = wSock.readShort();
Data.SpeedY = wSock.readShort();
Data.SpeedZ = wSock.readShort();
}
return Data;
}