本文整理汇总了C#中RbSerializerN类的典型用法代码示例。如果您正苦于以下问题:C# RbSerializerN类的具体用法?C# RbSerializerN怎么用?C# RbSerializerN使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RbSerializerN类属于命名空间,在下文中一共展示了RbSerializerN类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sizeOf
public int sizeOf(RbSerializerN serializer, Object obje)
{
var obj = (BulletStatus) obje;
return RbSerializerN.SIZEOF_TYPEINFO + RbSerializerN.SIZEOF_INT + serializer.sizeOf(obj.victimName)
+ RbSerializerN.SIZEOF_BOOL + 2*RbSerializerN.SIZEOF_DOUBLE;
}
示例2: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
{
var obj = (DebugProperty) obje;
serializer.serialize(buffer, obj.key);
serializer.serialize(buffer, obj.value);
}
示例3: deserialize
public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
String key = serializer.deserializeString(buffer);
String value = serializer.deserializeString(buffer);
return new DebugProperty(key, value);
}
示例4: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
{
var obj = (TeamMessage) obje;
serializer.serialize(buffer, obj.sender);
serializer.serialize(buffer, obj.recipient);
serializer.serialize(buffer, obj.message);
}
示例5: deserialize
public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
String sender = serializer.deserializeString(buffer);
String recipient = serializer.deserializeString(buffer);
byte[] message = serializer.deserializeBytes(buffer);
return new TeamMessage(sender, recipient, message);
}
示例6: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
{
var obj = (BulletCommand) obje;
serializer.serialize(buffer, obj.power);
serializer.serialize(buffer, obj.fireAssistValid);
serializer.serialize(buffer, obj.fireAssistAngle);
serializer.serialize(buffer, obj.bulletId);
}
示例7: deserialize
public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
double power = buffer.getDouble();
bool fireAssistValid = serializer.deserializeBoolean(buffer);
double fireAssistAngle = buffer.getDouble();
int bulletId = buffer.getInt();
return new BulletCommand(power, fireAssistValid, fireAssistAngle, bulletId);
}
示例8: sizeOf
public int sizeOf(RbSerializerN serializer, Object obje)
{
var obj = (TeamMessage) obje;
int s = serializer.sizeOf(obj.sender);
int r = serializer.sizeOf(obj.recipient);
int m = serializer.sizeOf(obj.message);
return RbSerializerN.SIZEOF_TYPEINFO + s + r + m;
}
示例9: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, object objec)
{
var obj = (KeyPressedEvent) objec;
serializer.serialize(buffer, obj.KeyChar);
serializer.serialize(buffer, obj.KeyCode);
serializer.serialize(buffer, obj.KeyLocation);
serializer.serialize(buffer, obj.ID);
serializer.serialize(buffer, obj.ModifiersEx);
serializer.serialize(buffer, obj.When);
}
示例10: deserialize
public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
int bulletId = buffer.getInt();
String victimName = serializer.deserializeString(buffer);
bool isActive = serializer.deserializeBoolean(buffer);
double x = buffer.getDouble();
double y = buffer.getDouble();
return new BulletStatus(bulletId, x, y, victimName, isActive);
}
示例11: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
{
var obj = (BulletStatus) obje;
serializer.serialize(buffer, obj.bulletId);
serializer.serialize(buffer, obj.victimName);
serializer.serialize(buffer, obj.isActive);
serializer.serialize(buffer, obj.x);
serializer.serialize(buffer, obj.y);
}
示例12: deserialize
public object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
char keyChar = buffer.getChar();
int keyCode = buffer.getInt();
int keyLocation = buffer.getInt();
int id = buffer.getInt();
int modifiersEx = buffer.getInt();
long when = buffer.getLong();
return new KeyPressedEvent(keyChar, keyCode, keyLocation, id, modifiersEx, when);
}
示例13: serialize
public void serialize(RbSerializerN serializer, ByteBuffer buffer, object objec)
{
var obj = (MouseClickedEvent) objec;
serializer.serialize(buffer, obj.Button);
serializer.serialize(buffer, obj.ClickCount);
serializer.serialize(buffer, obj.X);
serializer.serialize(buffer, obj.Y);
serializer.serialize(buffer, obj.ID);
serializer.serialize(buffer, obj.ModifiersEx);
serializer.serialize(buffer, obj.When);
}
示例14: BasicRobotProxy
public BasicRobotProxy(IRobotItem specification, IHostManager hostManager, IRobotPeer peer, RobotStatics statics)
: base(specification, hostManager, peer, statics)
{
eventManager = new EventManager(this);
graphicsProxy = new GraphicsProxy();
// dummy
execResults = new ExecResults(null, null, null, null, null, false, false, false);
setSetCallCount(0);
setGetCallCount(0);
var sharedBuffer = new byte[10*1024*100];
execJavaBuffer = new DirectByteBuffer(sharedBuffer);
execNetBuffer = ByteBuffer.wrap(sharedBuffer);
rbSerializerN = new RbSerializerN();
this.peer.setupBuffer(execJavaBuffer);
}
示例15: deserialize
public object deserialize(RbSerializerN serializer, ByteBuffer buffer)
{
string name = serializer.deserializeString(buffer);
double energy = buffer.getDouble();
double heading = buffer.getDouble();
double bearing = buffer.getDouble();
double distance = buffer.getDouble();
double velocity = buffer.getDouble();
bool isSentryRobot = serializer.deserializeBoolean(buffer);
return new ScannedRobotEvent(name, energy, bearing, distance, heading, velocity, isSentryRobot);
}