本文整理汇总了C#中Serial类的典型用法代码示例。如果您正苦于以下问题:C# Serial类的具体用法?C# Serial怎么用?C# Serial使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Serial类属于命名空间,在下文中一共展示了Serial类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectInfoPacket
public ObjectInfoPacket(PacketReader reader)
: base(0x1A, "ObjectInfoPacket")
{
Serial = reader.ReadInt32();
ItemID = reader.ReadUInt16();
Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0);
X = reader.ReadInt16();
Y = reader.ReadInt16();
Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0);
Z = reader.ReadSByte();
Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0);
Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0);
// sanitize values
Serial = (int)(Serial & 0x7FFFFFFF);
ItemID = (ushort)(ItemID & 0x7FFF);
X = (short)(X & 0x7FFF);
Y = (short)(Y & 0x3FFF);
}
示例2: GetPlayerStatusPacket
public GetPlayerStatusPacket(byte type, Serial serial)
: base(0x34, "Get Player Status", 10)
{
Stream.Write(0xEDEDEDED);//Unknown
Stream.Write((byte)type);
Stream.Write(serial);
}
示例3: ZinagaPants
public ZinagaPants(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
示例4: PartyHealthTrackerGump
public PartyHealthTrackerGump(PartyMember member)
: base(member.Serial, 0)
{
while (UserInterface.GetControl<MobileHealthTrackerGump>() != null)
{
UserInterface.GetControl<MobileHealthTrackerGump>(member.Serial).Dispose();
}
IsMoveable = false;
IsUncloseableWithRMB = true;
m_Serial = member.Serial;
//AddControl(m_Background = new ResizePic(this, 0, 0, 3000, 131, 48));//I need opacity %1 background
AddControl(m_Name = new TextLabel(this, 1, 0, 1, member.Name));
//m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; //maybe private message calling?
m_BarBGs = new GumpPic[3];
int sameX = 15;
int sameY = 3;
if (WorldModel.Entities.GetPlayerEntity().Serial != member.Serial)//you can't send a message to self
{
AddControl(btnPrivateMsg = new Button(this, 0, 20, 11401, 11402, ButtonTypes.Activate, member.Serial, 0));//private party message / use bandage ??
}
AddControl(m_BarBGs[0] = new GumpPic(this, sameX, 15 + sameY, 9750, 0));
AddControl(m_BarBGs[1] = new GumpPic(this, sameX, 24 + sameY, 9750, 0));
AddControl(m_BarBGs[2] = new GumpPic(this, sameX, 33 + sameY, 9750, 0));
m_Bars = new GumpPicWithWidth[3];
AddControl(m_Bars[0] = new GumpPicWithWidth(this, sameX, 15 + sameY, 40, 0, 1f));//I couldn't find correct visual
AddControl(m_Bars[1] = new GumpPicWithWidth(this, sameX, 24 + sameY, 9751, 0, 1f));//I couldn't find correct visual
AddControl(m_Bars[2] = new GumpPicWithWidth(this, sameX, 33 + sameY, 41, 0, 1f));//I couldn't find correct visual
// bars should not handle mouse input, pass it to the background gump.
for (int i = 0; i < m_BarBGs.Length; i++)//???
{
m_Bars[i].HandlesMouseInput = false;
}
}
示例5: DropToLayerPacket
public DropToLayerPacket(Serial itemSerial, byte layer, Serial playerSerial)
: base(0x13, "Drop To Layer", 10)
{
Stream.Write(itemSerial);
Stream.Write((byte)layer);
Stream.Write(playerSerial);
}
示例6: BeltOfTheMagi
public BeltOfTheMagi( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
示例7: TopMenu
public TopMenu(Serial serial)
: base(serial, 0)
{
// maximized view
AddControl(new ResizePic(this, 1, 0, 0, 9200, 610, 27));
AddControl(new Button(this, 1, 5, 3, 5540, 5542, 0, 2, 0));
((Button)LastControl).GumpOverID = 5541;
// buttons are 2443 small, 2445 big
// 30, 93, 201, 309, 417, 480, 543
// map, paperdollB, inventoryB, journalB, chat, help, < ? >
AddControl(new Button(this, 1, 30, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Map));
((Button)LastControl).Caption = "<basefont color=#000000>Map";
AddControl(new Button(this, 1, 93, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Paperdoll));
((Button)LastControl).Caption = "<basefont color=#000000>Paperdoll";
AddControl(new Button(this, 1, 201, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Inventory));
((Button)LastControl).Caption = "<basefont color=#000000>Inventory";
AddControl(new Button(this, 1, 309, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Journal));
((Button)LastControl).Caption = "<basefont color=#000000>Journal";
AddControl(new Button(this, 1, 417, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Chat));
((Button)LastControl).Caption = "<basefont color=#000000>Chat";
AddControl(new Button(this, 1, 480, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Help));
((Button)LastControl).Caption = "<basefont color=#000000>Help";
AddControl(new Button(this, 1, 543, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Question));
((Button)LastControl).Caption = "<basefont color=#000000>Debug";
// minimized view
AddControl(new ResizePic(this, 2, 0, 0, 9200, 30, 27));
AddControl(new Button(this, 2, 5, 3, 5537, 5539, 0, 1, 0));
((Button)LastControl).GumpOverID = 5538;
}
示例8: AlligatorBelt
public AlligatorBelt( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
示例9: Mobile
public Mobile(Serial serial)
: base(serial)
{
m_equipment = new MobileEquipment(this);
m_animation = new MobileAnimation(this);
m_movement.RequiresUpdate = true;
}
示例10: CloakOfTheGodlyTailor
public CloakOfTheGodlyTailor(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
示例11: CustomHousePacket
public CustomHousePacket(PacketReader reader)
: base(0xD8, "Custom House Packet")
{
byte CompressionType = reader.ReadByte();
if (CompressionType != 3)
{
_houseSerial = Serial.Null;
return;
}
reader.ReadByte(); // unknown, always 0?
_houseSerial = reader.ReadInt32();
_revisionHash = reader.ReadInt32();
// this is for compression type 3 only
int bufferLength = reader.ReadInt16();
int trueBufferLength = reader.ReadInt16();
_numPlanes = reader.ReadByte();
// end compression type 3
_planes = new CustomHousePlane[_numPlanes];
for (int i = 0; i < _numPlanes; i++)
{
_planes[i] = new CustomHousePlane(reader);
}
}
示例12: EquipmentEntry
public EquipmentEntry(Serial serial, ushort gumpId, byte layer, ushort hue)
{
Serial = serial;
GumpId = gumpId;
Layer = layer;
Hue = hue;
}
示例13: QuestGumpRequestPacket
public QuestGumpRequestPacket(Serial serial)
: base(0xD7, "Quest gump request")
{
Stream.Write(serial);
Stream.Write((ushort)0x0032);
Stream.Write((byte)0x00);
}
示例14: DruidCloak
public DruidCloak( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
示例15: ContextMenuResponsePacket
public ContextMenuResponsePacket(Serial serial, short responseIndex)
: base(0xBF, "Context Menu Response")
{
Stream.Write((short)0x15); // subcommand 0x15, response to context menu
Stream.Write((int)serial);
Stream.Write((short)responseIndex);
}