本文整理汇总了C#中IValueWriter类的典型用法代码示例。如果您正苦于以下问题:C# IValueWriter类的具体用法?C# IValueWriter怎么用?C# IValueWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IValueWriter类属于命名空间,在下文中一共展示了IValueWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WritePayload
public override void WritePayload(IValueWriter writerm)
{
writerm.WriteUInt32(this.NetworkID);
writerm.WriteString(this.CharacterName);
writerm.WriteByte((byte)this.Action);
}
示例2: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
using (var ms = new MemoryStream())
{
ScreenFrame.Save(ms, ImageFormat.Png);
writer.WriteBytes(ms.GetBuffer());
}
}
示例3: WritePayload
public override void WritePayload (ISerializationContext context, IValueWriter writer)
{
if (writer.WriteBool (SenderId != null))
writer.WriteString (SenderId);
writer.WriteInt32 (GroupId);
writer.WriteString (Text);
}
示例4: WritePayload
public override void WritePayload(IValueWriter writer)
{
base.WritePayload(writer);
writer.WriteBytes(InternalOwnEndPoint.Address.GetAddressBytes());
writer.WriteInt32(InternalOwnEndPoint.Port);
writer.WriteBytes(ExternalPeerEndPoint.Address.GetAddressBytes());
writer.WriteInt32(ExternalPeerEndPoint.Port);
}
示例5: Write
public void Write(IValueWriter writer)
{
writer.Write(_grhIndexValueKey, GrhIndex);
writer.Write(_sourceValueKey, SourceName);
writer.Write(_destValueKey, DestName);
writer.Write(_offsetValueKey, Offset);
writer.Write(_originValueKey, Origin);
}
示例6: WritePayload
public override void WritePayload(IValueWriter writer)
{
if (String.IsNullOrEmpty (this.Password))
throw new InvalidOperationException ("Can not login without a password.");
writer.WriteString (Username);
writer.WriteString (Password);
}
示例7: Serialize
public void Serialize(IValueWriter writer)
{
writer.WriteBool (this.NonCharacter);
writer.WriteInt32 (this.PlayerID);
writer.WriteInt32 (this.path.Count);
foreach(Directions dir in this.path)
writer.WriteInt32 ((int) dir);
}
示例8: WritePayload
public override void WritePayload(ISerializationContext context, IValueWriter writer)
{
writer.WriteInt32 (Entities.Count);
foreach (SnapshotEntity sentity in Entities)
{
WriteEntity (sentity.Entity, context, writer);
}
}
示例9: WritePayload
public override void WritePayload(IValueWriter writer)
{
writer.WriteUInt32 (this.NetworkID);
writer.WriteInt32 (this.X);
writer.WriteInt32 (this.Y);
writer.WriteInt32 (this.Direction);
writer.WriteString (this.Animation);
}
示例10: WritePayload
public override void WritePayload(IValueWriter writer)
{
writer.WriteInt32 (this.EventCommands.Count);
foreach(IEventCommand command in this.EventCommands)
{
writer.WriteInt32 ((int) command.Command);
command.Serialize (writer);
}
}
示例11: NetworkServerConnection
internal NetworkServerConnection(NetworkServerConnectionProvider provider, uint nid, TcpClient tcp, IPEndPoint endPoint, IValueWriter uwriter)
{
this.NetworkId = nid;
this.Tcp = tcp;
this.ReliableStream = tcp.GetStream ();
this.provider = provider;
this.EndPoint = endPoint;
this.UnreliableWriter = uwriter;
this.ReliableReader = new StreamValueReader (ReliableStream);
this.ReliableWriter = new StreamValueWriter (ReliableStream);
}
示例12: WriteState
/// <summary>
/// Writes the state of the object to an <see cref="IValueWriter"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write the values to.</param>
public void WriteState(IValueWriter writer)
{
PersistableHelper.Write(this, writer);
// Equipped bodies
Debug.Assert(_equippedBodies.Count <= byte.MaxValue);
writer.Write("EquippedBodiesCount", (byte)_equippedBodies.Count);
for (var i = 0; i < _equippedBodies.Count; i++)
{
writer.Write("EquippedBody_" + i, _equippedBodies[i]);
}
}
示例13: WriteCustomValues
/// <summary>
/// When overridden in the derived class, writes all custom state values to the <paramref name="writer"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write the state values to.</param>
protected override void WriteCustomValues(IValueWriter writer)
{
writer.Write("SerializedValue", SerializedValue);
}
示例14: Write
/// <summary>
/// Writes the <see cref="ColumnSchema"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
public void Write(IValueWriter writer)
{
var v = _values.OrderBy(x => x.Key).ToArray();
writer.WriteManyNodes(_valuesNodeName, v, WriteKVP);
}
示例15: Write
/// <summary>
/// Writes the <see cref="Skeleton"/> to an <see cref="IValueWriter"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
/// <exception cref="ArgumentNullException"><paramref name="writer" /> is <c>null</c>.</exception>
public void Write(IValueWriter writer)
{
if (writer == null)
throw new ArgumentNullException("writer");
writer.WriteManyNodes(_nodesNodeName, RootNode.GetAllNodes(), ((w, item) => item.Write(w)));
}